题解 | #学生基本信息输入输出#
学生基本信息输入输出
https://www.nowcoder.com/practice/58b6a69b4bf943b49d2cd3c15770b9fd
#include <stdio.h>
int main()
{
long num;
double a,b,c;
scanf("%ld;%lf,%lf,%lf",&num,&a,&b,&c);
//四舍五入公式(保留n位小数):x = (int)(x*10^n + 0.5)/10^n.0
a = (int)(a*100+0.5)/100.0;
b = (int)(b*100+0.5)/100.0;
c = (int)(c*100+0.5)/100.0;
printf("The each subject score of No. %ld is %.2lf, %.2lf, %.2lf.\n", num,a,b,c);
return 0;
}
携程工作强度 160人发布
查看4道真题和解析