Problem prime
User foo
Submission Time 2023-03-02 17:06:43
Score 0
Max Time N/A
Max Memory N/A

Compile Error

prime.cpp:2:8: error: expected constructor, destructor, or type conversion before ‘(’ token
2 | isPrime(n){if(n==2||n==3)return true;if(n<2||n%2==0||n%3==0)return false;for(int i=5;i*i<n;i+=6){if(n%i==0||n%(i+2)==0)return false;}return true;}main(){int n;std::cin>>n;if(isPrime(n))std::cout<<"Prime";else std::cout<<"Not Prime"}
| ^
prime.cpp: In function ‘int main()’:
prime.cpp:2:175: error: ‘isPrime’ was not declared in this scope
2 | isPrime(n){if(n==2||n==3)return true;if(n<2||n%2==0||n%3==0)return false;for(int i=5;i*i<n;i+=6){if(n%i==0||n%(i+2)==0)return false;}return true;}main(){int n;std::cin>>n;if(isPrime(n))std::cout<<"Prime";else std::cout<<"Not Prime"}
| ^~~~~~~
prime.cpp:2:232: error: expected ‘;’ before ‘}’