fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=1,b=2,c,i,ans=0;
  5. for(i=1;i<100000;i++)
  6. {
  7. c = 3 * b + 2 * a;
  8. a = b;
  9. b = c;
  10. printf("%d",c);
  11. if(c >= 100 && c <=1000)
  12. {
  13. ans += 1;
  14. }
  15. else if(c > 1000)
  16. {
  17. break;
  18. }
  19. }
  20. printf("\n");
  21. printf("%d",ans);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
8281003561268
2