Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
check Prime
#include <iostream> using namespace std; int main() { int num,i; cin>>num; if(num==0 || num == 1) cout<<"The smallest number is 2"; for(i = 2; i < num; i++) if(num%i==0) { cout<<"Not prime"; break; } if(num == i) cout<<"prime"; }
run
|
edit
|
history
|
help
0
File System
dijkstra's algo
ExceptExpo
Double_wrapper gcc
¡Arriba, Papalotes, Arriba!
N Queens problem
congruence modulo equations (together with a simple BigInteger class)
RandomMessage
Cuantos dedos
Default copy