#include int prime(int p){ int j,sum=0,k,flag=0; for(j=3;j<=p;j++){ flag=0; for(k=2;k