菜鸟学c++求助。。
输出100以内质数,源代码如下。。错在哪了?请指教一下。。谢谢。。#include <iostream.h>
void main()
{ int a=3,b=2,r=1;
while (a<100)
{
while (a>b)
{
r=a%b;
if (r=0) {cout<<a<<endl;}else{b=b+1;}
}
a=a+1;
}
}
2008-03-06 00:51
2008-03-06 10:07
2008-03-06 12:47
2008-03-06 17:13
2008-03-06 19:12
2008-03-08 22:49