#include<stdio.h>
int main()
{
double a, b, c;
scanf("%3f%3f%3f", &a, &b, &c);
printf("%.3f\n", a + b + c);
printf("%.3f\n", (a + b + c) / 3.000);
return 0;
}
有问题吗?
有请说出来。
#include<stdio.h>
int main()
{ for (int a = 1; a <= 9; a++) for (int b = 0; b <= 9; b++) for (int c = 0; c <= 9; c++) { int ABC = a * 100 + b * 10 + c; if (ABC < 100) continue; if (ABC > 999) break; if (ABC == a * a * a+ b * b * b + c * c * c) printf("%d", ABC); } return 0;
}
#include<stdio.h>
int main()
{ for (int a = 1; a <= 9; a++) for (int b = 0; b <= 9; b++) for (int c = 0; c <= 9; c++) { int ABC = a * 100 + b * 10 + c; if (ABC < 100) continue; if (ABC > 999) break; if (ABC == a * a * a+ b * b * b + c * c * c) printf("%d", ABC); } return 0;
}