int main() { int x, y, z, min, max; printf("Введите x и y:\n"); scanf("%d %d", &x, &y); if (x<y) min = x; else min = y; if (x*y>x+y) max = x*y; else max = x+y; printf("min = %d max = %d\n",min,max); z = min+max; printf("z = %d",z); system("pause"); return 0; }
Пример: Введите x и y: 10 45 min = 10 max = 450 z = 460
int main()
{
int x, y, z, min, max;
printf("Введите x и y:\n");
scanf("%d %d", &x, &y);
if (x<y) min = x; else min = y;
if (x*y>x+y) max = x*y; else max = x+y;
printf("min = %d max = %d\n",min,max);
z = min+max;
printf("z = %d",z);
system("pause");
return 0;
}
Пример:
Введите x и y:
10 45
min = 10 max = 450
z = 460