69,373
社区成员
发帖
与我相关
我的任务
分享
int i;
char fn[80];
char ln[80];
FILE *f;
int i;
for (i=0;i<10;i++) {
sprintf(fn,"FILE%d.txt",i);
f=fopen(fn,"r");
if (NULL!=f) {
printf("%s:\n",fn);
while (1) {
if (NULL==fgets(ln,80,f)) break;
printf("%s",ln);
}
fclose(f);
}
}
for(int i = 0;i < NUM_MAX;++i)
{
while(condition == true)
{
//begin
//over
condition = false;//当满足跳出循环的某种条件后将其置为假,以便跳到for循环中
//结果是显然的,下一次执行for循环时,while条件为假,执行不了,可能这就是后果吧
}
}
for(int i = 0;i < NUM_MAX;++i)
{
for(bool condition == true;condition;)
{
//begin
//over
condition = false;//当满足跳出循环的某种条件后将其置为假,以便跳到for循环中
//这样处理让每次里循环都有机会
}
}