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

学生基本信息输入输出

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

#include <stdio.h>
int main(void)
{
    int studentID=0;
    float CPL=0;
    float math=0;
    float English=0;
    scanf("%d;%f,%f,%f",&studentID,&CPL,&math,&English);
    if(studentID < 1 && studentID > 20000000)
    {
        printf("输入错误!");
    }
    if(CPL <0 && CPL >100 && math <0 && math >100 && English <0 && English >100)
    {
        printf("输入错误!");
    }
    printf("The each subject score of No. %d is %.2f, %.2f, %.2f.",studentID,CPL,math,English);




    return 0;
}

全部评论

相关推荐

06-07 19:59
门头沟学院 C++
补药卡我啊😭:都快15年前的了还在11新特性
你的简历改到第几版了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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