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