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

学生基本信息输入输出

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

#include <stdio.h>
int main()
{
    int Student_ID = 0;
    float score_C = 0.0,score_M = 0.0,score_E = 0.0;
    scanf("%d;%f,%f,%f",&Student_ID, &score_C, &score_M, &score_E);
    printf("The each subject score of No. %d is %.2f, %.2f, %.2f.", Student_ID,score_C,score_M,score_E);
    return 0;
}

//使用的是C语言
/*
#include<stdio.h>
int main()
{
    int a;
    float b,c,d;
    scanf("%d;%f,%f,%f",&a,&b,&c,&d);
     printf("The each subject score of No. %d is %.2f, %.2f, %.2f.", a, b, c, d);
return 0;
}
*/

本题最大的坑在于打印格式,一个空格和字符位置都不能变,不要相信自己的眼睛,最好复制粘贴!!!

全部评论

相关推荐

牛客21331815...:像我一投就pass,根本不用焦虑泡池子
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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