fork(2) download
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. bool czy_pierwsza (int n)
  5. {
  6. if(n<2)
  7. return false ;
  8. for(int i=2 ; i*i<=n ; i++)
  9. if (n%i==0)
  10. return false ;
  11. else return true ;
  12. }
  13. int main()
  14. {
  15. int n,m;
  16. cin>>m;
  17. for (int i = 0; i<m; i++)
  18. {
  19. cin>> n ;
  20.  
  21. if (czy_pierwsza(n))
  22. cout<< "TAK" << endl ;
  23. else
  24. cout << "NIE "<<endl ;
  25.  
  26.  
  27. }
  28.  
  29. return 0;
  30. }
  31.  
  32.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘bool czy_pierwsza(int)’:
prog.cpp:34:10: error: redefinition of ‘bool czy_pierwsza(int)’
     bool czy_pierwsza (int n)
          ^~~~~~~~~~~~
prog.cpp:4:10: note: ‘bool czy_pierwsza(int)’ previously defined here
     bool czy_pierwsza (int n)
          ^~~~~~~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:43:9: error: redefinition of ‘int main()’
     int main()
         ^~~~
prog.cpp:13:9: note: ‘int main()’ previously defined here
     int main()
         ^~~~
stdout
Standard output is empty