题解 | 学生基本信息输入输出
学生基本信息输入输出
https://www.nowcoder.com/practice/58b6a69b4bf943b49d2cd3c15770b9fd
#include<bits/stdc++.h>
using namespace std;
int main(){
int no;
double c,m,e;
scanf("%d;%lf,%lf,%lf",&no,&c,&m,&e);
c = (int)(c*100+0.5);
c = (float)(c/100);
m = (int)(m*100+0.5);
m = (float)(m/100);
e = (int)(e*100+0.5);
e = (float)(e/100);
printf("The each subject score of No. %d is %.2f, %.2f, %.2f.",no,c,m,e);
return 0;
}

查看20道真题和解析