#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int first[4];
char operations[4];
int second[4];
for (int i = 0; i < 4; ++i)
scanf("%i", &first[i]);
int k = 0;
while (k != 4){
char c;
c = getchar();
if (c != '-' && c != '+' && c != '*' && c != '/') {
continue;
}
operations[k] = c;
k++;
}
for (int i = 0; i < 4; ++i)
scanf("%i", &second[i]);
for (int i = 0; i < 4; ++i) {
switch (operations[i]) {
case '*':
printf("%i\n", first[i] * second[i]);
break;
case '/':
printf("%i\n", first[i] / second[i]);
break;
case '+':
printf("%i\n", first[i] + second[i]);
break;
case '-':
printf("%i\n", first[i] - second[i]);
break;
}
}
return 0;
}
3
2
4
1
вот так
Объяснение:
а і ето все?