题解 | #学生基本信息输入输出#

学生基本信息输入输出

http://www.nowcoder.com/practice/58b6a69b4bf943b49d2cd3c15770b9fd

#include<stdio.h>
struct Stu{
    int id;
    float  C_score;
    float Math_score;
    float English_score;
};

int main(){
    struct Stu s;
    do{
    scanf("%d ; %f , %f , %f",&s.id,&s.C_score,&s.Math_score,&s.English_score);
    }while((s.id>200000000||s.id<1)||(s.C_score>150||s.C_score<0)
           ||(s.English_score>150||s.English_score<0)
           ||(s.Math_score>150||s.Math_score<0));
    printf("The each subject score of No. %d is %.2f, %.2f, %.2f.",s.id,s.C_score,s.Math_score,s.English_score);
    return 0;
}
全部评论

相关推荐

10-02 19:29
已编辑
浙江科技大学 运营
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务