fork download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4. int c=0;
  5. int a[33];
  6. int k,s,u;
  7. s=0;
  8.  
  9. a[0]=2;
  10. a[1]=-1;
  11.  
  12. for(int i=0;i<31;i++){
  13. a[i+2]=0-a[i+1]+a[i]+2;
  14. }
  15.  
  16. for(k=0;k<=32;k++){
  17. c=0;
  18. if (a[k] <= 1) continue;
  19.  
  20. for(u=2;u<a[k];u++){
  21. if(a[k]%u==0) c++;
  22. }
  23.  
  24. if(c==0) s++;
  25. }
  26.  
  27. printf("%d",s);
  28. return 0;
  29. }
Success #stdin #stdout 0.03s 5308KB
stdin
Standard input is empty
stdout
7