| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 593 人关注过本帖
标题:菜鸟问话: 数据始终输不进去(Turbo C),?????
只看楼主 加入收藏
dsp6414
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-5-25
收藏
 问题点数:0 回复次数:3 
菜鸟问话: 数据始终输不进去(Turbo C),?????
main()
{   
struct student
{
 char name[10];
 float score[3];
};
int i,j;
struct student stud[5];
for(j=0;j<5;j++)
  {
   printf("\nname:");
   gets(stud[j].name);
   for(i=0;i<3;i++)
    {
      printf("\nscore%d:",i);
      scanf("%f",&stud[j].score[i]);
   }
     
  }
  for(j=0;j<5;j++)
   printf("\n%s,%f,%f,%f",stud[i].name,stud[j].score[0],stud[j].score[1],stud[j].score[2]);   
   getch();
}
搜索更多相关主题的帖子: 问话 数据 Turbo 
2005-05-25 11:29
空前
Rank: 1
等 级:新手上路
帖 子:1146
专家分:0
注 册:2004-5-11
收藏
得分:0 
main()
{   
struct student
{
char name[10];
float score[3];
};
int i,j;
float f;
struct student stud[5];
for(j=0;j<5;j++)
  {
   printf("\nname:");
   gets(stud[j].name);
   for(i=0;i<3;i++)
    {
      printf("\nscore%d:",i);
      scanf("%f",&f),stud[j].score[i]=f;
   }
     
  }
  for(j=0;j<5;j++)
   printf("\n%s,%f,%f,%f",stud[i].name,stud[j].score[0],stud[j].score[1],stud[j].score[2]);   
   getch();
}


2005-05-25 12:16
musicml
Rank: 1
等 级:新手上路
帖 子:273
专家分:0
注 册:2005-4-2
收藏
得分:0 

#include <stdio.h> #include <conio.h>

int main() { struct student { char name[10]; float score[3]; }; int i,j; struct student stud[3]; for(j=0;j<3;j++) { printf("\nname:"); gets(stud[j].name); for(i=0;i<3;i++) { printf("\nscore%d:",i); scanf("%f",&stud[j].score[i]); fflush(stdin); } } for(j=0;j<3;j++) printf("\n%s,%f,%f,%f",stud[j].name,stud[j].score[0],stud[j].score[1],stud[j].score[2]); return 0;

}


Every thing is possible.
2005-05-25 13:32
修因
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2005-5-19
收藏
得分:0 
你们见过这样的结构体么?
struct student
{
char name[10];
float score[3];
};

2005-05-27 14:31
快速回复:菜鸟问话: 数据始终输不进去(Turbo C),?????
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019791 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved