搜索
查看: 348|回复: 0
打印 上一主题 下一主题

求助 为什么运行了是空白

[复制链接]
跳转到指定楼层
楼主
 楼主| 发表于 2020-12-30 10:14:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5啊哈币
  1. #include<stdio.h>

  2. struct Student
  3. {
  4.     int num;
  5.     char name[20];
  6.     float score;
  7. };
  8.     int main()
  9. {
  10.     struct Student student1,student2;
  11.     scanf("%d,%s,%f",&student1.num,student1.name,&student1.score);
  12.     scanf("%d,%s,%f",&student2.num,student2.name,&student2.score);
  13.     printf("the high score is:");
  14.     if(student1.score>student2.score)
  15. {
  16.     printf("%d%s%f",student1.num,student1.name,student1.score);
  17. }
  18.     else if(student1.score<student2.score)
  19. {
  20.     printf("%d%s%f",student2.num,student2.name,student2.score);
  21. }
  22.     else
  23. {
  24.      printf("%d%s%f",student1.num,student1.name,student1.score);
  25.      printf("%d%s%f",student2.num,student2.name,student2.score);
  26. }
  27. return 0;
  28. }   
复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表