qq_43435095 2022-03-17 16:58 采纳率: 66.7%
浏览 19
已结题

这个输入了没有输出是怎么回事

#include<stdio.h>
int main()
{
struct student
{
int num;
char sex;
int score;
char name[];
char location[];

};
struct student student1,student2;

scanf("%d%c%d%s%s%d%c%d%s%s",&student1.num,&student1.sex,&student1.score,student1.name,student1.location,&student2.num,&student2.sex,&student2.score,student2.name,student2.location);
if(student1.score>student2.score)
printf("num:%d\nsex:%s\nscore:%d\nname:%s\nlocation:%s\n",student1.num,student1.sex,student1.score,student1.name,student1.location);
else if(student1.score<student2.score)
printf("num:%d\nsex:%s\nscore:%d\nname:%s\nlocation:%s\n",student2.num,student2.sex,student2.score,student2.name,student2.location);
else
{printf("num:%d\nsex:%c\nscore:%d\nname:%s\nlocation:%s\n",student2.num,student2.sex,student2.score,student2.name,student2.location);
printf("num:%d\nsex:%c\nscore:%d\nname:%s\nlocation:%s\n",student1.num,student1.sex,student1.score,student1.name,student1.location);
}
return 0;
}

  • 写回答

2条回答 默认 最新

  • 卡尔曼的BD SLAMer 计算机视觉领域新星创作者 2022-03-17 17:56
    关注

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 3月25日
  • 已采纳回答 3月17日
  • 创建了问题 3月17日

悬赏问题

  • ¥15 c#如何使用scottplot给已画好的自定义热度图,增加一个一定的colorbar
  • ¥15 信贷平台.用户信用评估和风险评估怎么做,希望来个做过的Java.有合作的机会
  • ¥15 IMageEN获得图形顶点坐标的问题
  • ¥50 软件PC客户端抓包,获取http请求和响应
  • ¥15 手机被安装黑客软件怎么办?
  • ¥15 Windows C++ PaddleOcr 中文模型的训练方法
  • ¥15 c# 用scottplot画 以时间为纵坐标,数值为横坐标画曲线图
  • ¥15 手机应用程序安装异常
  • ¥15 grbl的G92修改MPos的问题。
  • ¥15 vue2中,Ant Design Pro s-table中,使用服务端排序怎么做