C语言程序改错

[复制链接]
查看11 | 回复1 | 2008-7-1 13:10:30 | 显示全部楼层 |阅读模式
#include
main()
{
int a[100],b[100],c[100];
int i,j,sum,aaa,f;

while(f!=0)

{

for(i=0;1;i++)

{

printf("input the 学分");

scanf("%d",&a);

f=a;

printf("input the 分数");

scanf("%d",&b);

}

}




for(j=0,jmain(){ int a[100],b[100],c[100]; int i,j,sum,aaa,f; //while(f!=0) //{for(i=0;1;i++)//for中间的条件判断是1(永远为true), 无限循环,外面的while不起作用,无法跳出{ printf("input the a ?? "); scanf("%d",&a); f=a; if(f==0) // <-- 读到0
break; // <-- 就跳出循环 printf("input the b ?? "); scanf("%
回复

使用道具 举报

千问 | 2008-7-1 13:10:30 | 显示全部楼层
for(j=0;j<i;j++)中间用分号不是逗号
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行