返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     re:
  7.         system("cls");
  8.         int a;
  9.         for(int j=1; j<=1000; j++){
  10.             for(int i=1; i<j; i++){
  11.                 if(j%i==0){
  12.                     a=i;
  13.                 }
  14.             }
  15.             if(a==1){
  16.                 cout<<j<<"\t ";
  17.             }
  18.         }

  19.         system("pause");
  20.         goto re;
  21.         return 0;
  22. }
複製代碼

TOP

返回列表