| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 371 人关注过本帖
标题:看看我的数组数据。谢谢!
只看楼主 加入收藏
crespo2008
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2007-8-25
收藏
 问题点数:0 回复次数:3 
看看我的数组数据。谢谢!
下面是我写的程序,为什么我输出的数组数据全都是0,没有保存到吗?求助!!!
#include "stdio.h"
main()
{int n,w,m,i,k;int score[40][3];
printf("welcome!!,printf input the data necessary.\n");
printf("input the number of schools\n n=");
scanf("%d",&n);
printf("\ninput the number of girl items\n w=");
scanf("%d",&w);
printf("\ninput the number of boy items\n m=");
scanf("%d",&m);

for(i=1;i<=m+w;i++)
for(k=1;k<=3;k++)
{printf("please input the NO.%d item,the number of rank %d school\nscore[%d-1][%d-1]=",i,k,i,k);
scanf("%d",score[i-1][k-1]);
}

for(k=0;k<3;k++)
{for(i=0;i<m+w;i++)
printf("%d ",score[i][k]);
printf("\n");
}
}
搜索更多相关主题的帖子: 数据 
2007-08-25 11:07
魔城侠客
Rank: 1
等 级:新手上路
帖 子:200
专家分:0
注 册:2006-4-4
收藏
得分:0 

#include "stdio.h"
main()
{int n,w,m,i,k;int score[40][3];
printf("welcome!!,printf input the data necessary.\n");
printf("input the number of schools\n n=");
scanf("%d",&n);
printf("\ninput the number of girl items\n w=");
scanf("%d",&w);
printf("\ninput the number of boy items\n m=");
scanf("%d",&m);

for(i=1;i<=m+w;i++)
for(k=1;k<=3;k++)
{printf("please input the NO.%d item,the number of rank %d school\nscore[%d-1][%d-1]=",i,k,i,k);
scanf("%d",&score[i-1][k-1]); //这里要取地址
}

for(k=0;k<3;k++)
{for(i=0;i<m+w;i++)
printf("%d ",score[i][k]);
printf("\n");
}
}


West and east,home is best……
2007-08-25 12:23
zzxwill
Rank: 1
等 级:新手上路
帖 子:398
专家分:0
注 册:2007-8-15
收藏
得分:0 

#include "stdio.h"
main()
{int n,w,m,i,k;int score[40][3];
printf("welcome!!,printf input the data necessary.\n");
printf("input the number of schools\n n=");
scanf("%d",&n);
printf("\ninput the number of girl items\n w=");
scanf("%d",&w);
printf("\ninput the number of boy items\n m=");
scanf("%d",&m);

for(i=1;i<=m+w;i++)
for(k=1;k<=3;k++)
{printf("please input the NO.%d item,the number of rank %d school\nscore[%d-1][%d-1]=",i,k,i,k);
scanf("%d",&score[i-1][k-1]);//魔城侠客对~
}

for(i=0;i<m+w;i++)
{for(k=0;k<3;k++)//这样稍稍规范一点。
printf("%d ",score[i][k]);
printf("\n");
}
}


一分耕耘,一分收获。
2007-08-27 22:57
雨中飞燕
Rank: 3Rank: 3
等 级:禁止访问
威 望:8
帖 子:2200
专家分:0
注 册:2007-8-9
收藏
得分:0 
那个无所谓规范不规范,是输出顺序的问题



by 雨中飞燕 QQ:78803110 QQ讨论群:5305909

请大家不要用TC来学习C语言
C/C++算法习题(OnlineJudge):[url]http://yzfy.org/[/url]
2007-08-27 23:03
快速回复:看看我的数组数据。谢谢!
数据加载中...
 
   



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

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