啊哈磊_编程从这里起步

标题: 求助 为什么运行了是空白 [打印本页]

作者: 皆非    时间: 2020-12-30 10:14
标题: 求助 为什么运行了是空白
  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. }   
复制代码





欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2