initial
This commit is contained in:
commit
2802401eee
79 changed files with 2650 additions and 0 deletions
33
1sem/adaptation courses/2/5.cpp
Normal file
33
1sem/adaptation courses/2/5.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// ac_2_5.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <stdio.h>
|
||||
#include <cmath>
|
||||
#include <clocale>
|
||||
#include <afxres.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(CP_UTF8);
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
setlocale(LC_ALL, "ru_RU.UTF-8");
|
||||
int h, m;
|
||||
scanf("%d %d", &h, &m);
|
||||
h += m > 59;
|
||||
if (h > 24) {
|
||||
printf("Exception: hours > 24");
|
||||
return 0;
|
||||
}
|
||||
printf("%02d:%02d\n", h, m);
|
||||
if (h >= 6 && h < 12) {
|
||||
printf("Доброе утро!");
|
||||
}
|
||||
else if (h >= 12 && h < 18) {
|
||||
printf("Добрый день!");
|
||||
}
|
||||
else if (h >= 18 && h < 24) {
|
||||
printf("Добрый вечер!");
|
||||
}
|
||||
else if (h >= 0 && h < 6){
|
||||
printf("Доброй ночи!");
|
||||
}
|
||||
}
|
||||
25
1sem/adaptation courses/2/6.cpp
Normal file
25
1sem/adaptation courses/2/6.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// ac_2_6.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <stdio.h>
|
||||
#include <cmath>
|
||||
#include <clocale>
|
||||
#include <afxres.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(CP_UTF8);
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
setlocale(LC_ALL, "ru_RU.UTF-8");
|
||||
int c;
|
||||
scanf("%d", &c);
|
||||
int ln = c % 10;
|
||||
if ((ln == 0) || (ln >= 5 && ln <= 9) || (c % 100 == 11)) {
|
||||
printf("В аудитории %d студентов", c);
|
||||
}
|
||||
else if (ln == 1) {
|
||||
printf("В аудитории %d студент", c);
|
||||
}
|
||||
else if (ln > 1 && ln < 5) {
|
||||
printf("В аудитории %d студента", c);
|
||||
}
|
||||
}
|
||||
34
1sem/adaptation courses/2/7.cpp
Normal file
34
1sem/adaptation courses/2/7.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// ac_2_7.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <stdio.h>
|
||||
#include <cmath>
|
||||
#include <clocale>
|
||||
#include <afxres.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(CP_UTF8);
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
setlocale(LC_ALL, "ru_RU.UTF-8");
|
||||
double op1, op2;
|
||||
char f;
|
||||
printf("<first operand> <operator> <second operand> >>>");
|
||||
scanf("%lf %s %lf", &op1, &f, &op2);
|
||||
switch (f) {
|
||||
case '+':
|
||||
printf("%lf\n", op1 + op2);
|
||||
break;
|
||||
case '-':
|
||||
printf("%lf\n", op1 - op2);
|
||||
break;
|
||||
case '*':
|
||||
printf("%lf\n", op1 * op2);
|
||||
break;
|
||||
case '/':
|
||||
printf("%lf\n", op1 / op2);
|
||||
break;
|
||||
default:
|
||||
printf("Incorrect operator");
|
||||
break;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue