#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int cm = 0;
int foot = 0;
int inch = 0;
scanf("%d", &cm);
foot = cm / 30.48;
inch = (cm / 30.48 - foot) * 12;
printf("%d %d", foot,inch);
return 0;
}
第二道
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
float a,b = 0;
scanf("%f %f", &a, &b);
float x, y, z, t = 0;
x = a + b;
y = a - b;
z = a * b;
t = a / b;
printf("%0.0f + %0.0f = %0.0f\n",a,b,x);
printf("%0.0f - %0.0f = %0.0f\n", a, b, y);
printf("%0.0f * %0.0f = %0.0f\n", a, b, z);
printf("%0.0f / %0.0f = %0.2f\n", a, b, (float)t);
return 0;
}
第三道
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
float a, b, c, d = 0;
scanf("%f %f %f %f", &a, &b, &c, &d);//值得注意的 若要使结果是带小数,那么输入的值的类型也得是精度类型
int Sum = 0;
float Average = 0;
Sum = a + b + c + d;
Average = (a + b + c + d) / 4;
printf("Sum = %d",Sum);
printf(";");
printf("Average = %0.1f", Average);
return 0;
}