|
发表于 2023-12-13 21:47:07
|
显示全部楼层
#include <stdio.h>
void Student(int n,float a,float b,float c){
float A,B,C;
A=a/100;
B=b/100;
C=c/100;
printf("The each subject score of No. %d is %0.2lf,%0.2lf,%0.2lf.",n,A,B,C);
}
int main() {
int n;
int x,y,z;
scanf("%d %d %d %d",&n,&x,&y,&z);
Student(n,x,y,z);
return 0;
}
你好,这个输入成绩输出成绩 ,不需要循环while语句的,可以在开始的时候加一个判断if(1<=n&&n<=20000000)
scanf("%d;%.5f,%.5f,%.5f",&n,&x,&y,&z);
你这个语句我运行的时候出错了,引号里面的逗号和分号不应该加的
程序输入40 50 60 70 输出是40 0.50 0.60 0.70
我也是刚学c语言 有问题可以交流下 谢谢 |
|