题解 | #学生基本信息输入输出#
学生基本信息输入输出
http://www.nowcoder.com/practice/58b6a69b4bf943b49d2cd3c15770b9fd
#include <stdio.h>
int main(){
unsigned long int i;
double a,b,c;
scanf("%ld;%lf,%lf,%lf",&i,&a,&b,&c);
a=(a*1000+0.5)/1000;
b=(b*1000+0.5)/1000;//四舍五入操作;
b=(b*1000+0.5)/1000;
printf("The each subject score of No. %ld is %.2lf, %.2lf, %.2lf.",i,a,b,c);
return 0;
int main(){
unsigned long int i;
double a,b,c;
scanf("%ld;%lf,%lf,%lf",&i,&a,&b,&c);
a=(a*1000+0.5)/1000;
b=(b*1000+0.5)/1000;//四舍五入操作;
b=(b*1000+0.5)/1000;
printf("The each subject score of No. %ld is %.2lf, %.2lf, %.2lf.",i,a,b,c);
return 0;
}
//虽然但是,这是一道基础题,看了一下提交通过率,还是发现好多人都翻车了