返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=2;i<100;i++)
  7.     {
  8.         int x=0;   
  9.         for(int j=2;j<i;j++)
  10.         {
  11.            if(i%j==0)
  12.            {
  13.               x++;      
  14.            }           
  15.         }  
  16.         if( x == 0)
  17.      {
  18.         cout<<i<<endl;     
  19.      }   
  20.     }     
  21.     system("pause");
  22.     return 0;   
  23. }
複製代碼

TOP

返回列表