20211120
作者:互联网
//摄氏度和华氏度之间的换算
//20211120
//ZhangWenjing
#include<stdio.h>
int main(void)
{
int f = 0;
int c = 0;
scanf_s("%d", &f);
c = (f - 32) * 5 / 9;
printf("Celsius = %d", c);
return 0;
}
//是不是太胖了
//20211120
//ZhangWenjing
#include<stdio.h>
int main(void)
{
int h = 0;
float w = 0;
scanf_s("%d", &h);
if (h > 100 && h <= 300)
{
w = (h - 100)*0.9 * 2;
printf("%.1f", w);
}
return 0;
}
//求整数平均值
//20211120
//ZhuangWujin
#include<stdio.h>
int main(void)
{
int a, b, c, d;
scanf_s("%d %d %d %d", &a, &b, &c, &d);
double average = (a + b + c + d) / 4.0;
printf("Sum = %d; Average = %.1f", a + b + c + d, average);
return 0;
}
//简单四则运算
//202111120
//算术入门之加减乘除
#include<stdio.h>
int main(void)
{
int a, b;
scanf_s("%d %d", &a, &b);
if (b > 0 && b < 101 && a >= 0 && a < 101)
{
printf("%d + %d = %d\n", a, b, a + b);
printf("%d - %d = %d\n", a, b, a - b);
printf("%d * %d = %d\n", a, b, a * b);
if(a%b==0)
printf("%d / %d = %d", a, b, a / b);
else
printf("%d / %d = %d", a, b, a*1.0 / b);
}
return 0;
}
一个格式,我调了整整二十分钟,哭哭,我的水平还是这么差。
//计算平均分
//20211120
//Zhuangwujin
#include<stdio.h>
int main(void)
{
printf("math = 87, eng = 72, comp = 93, average = %d", (87 + 72 + 93) / 3);
return 0;
}
标签:int,void,includeint,printf,main,20211120 来源: https://www.cnblogs.com/lld2146/p/15582463.html