fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a[32],n,i,count,x,j;
  5. i=0;
  6. a[0]=2;
  7. a[1]=-1;
  8. x=0;
  9. for(n=2;n<=32;n++){
  10. a[n]=-a[n-1]+a[n-2]+2;}
  11. for(j=0;j<=32;j++){
  12. count=0;
  13. if(a[j]>=2){
  14. for(i=2;i<a[j];i++){
  15.  
  16. if(a[j]%i==0){
  17. count++;}}
  18. if(count==0){
  19. x++;
  20. }}}
  21. printf("%d",x);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.03s 5272KB
stdin
Standard input is empty
stdout
7