#include <stdio.h> int main() { int x; int y=2; int isPrime=1; int z; for (x=1;x<=100;x++){ while (x>y){ z=x%y;y++; if (z==0) isPrime=0; if (isPrime==1) printf("%d\n",x); } }return 0; }
我想输出0-100以内的素数,不知道这个代码错哪了,求大佬指教