#7908: ‘EOF’ was not declared in this scope 怎解


a951660a (煊)


#include<iostream>

using namespace std;

int main()
{
      int x,i,c;

      
      while( cin >> x ) 
      {
         if(x==EOF || x <2 || x >=2147483647 )
            break;
             for(i=2,c=0;i<=x/2;i++)
             {
                if(x%i==0)
                   c=1;
             }
         if (c==0)
            cout << "質數" << endl;
         else
            cout << "非質數" << endl; 
      }
      
      return 0;
}