我在C中有一个非常简单的问题。我试图编写一个简单的程序,在10
和100
之间输出10
的倍数(包括:在闭区间[10,100]
)跳过30
和70
并垂直输出值。ac迭代,同时跳过do while while循环中的给定值
这里是我的代码:
#include<stdio.h>
main()
{
int i=10;
do {
if(i==30||i==70)
continue;
printf("\n %d",i);
i++;
} while(i<100);
return 0;
}
程序停止在29
跳过30
,并继续成为永无止境的循环。哪里不对?
http://msdn.microsoft.com/en-us/library/0ceyyskb.aspx – pcnThird
很多人为这一个的声望点打炮...... –