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. if(c >= 100 && c <=1000)
  11. {
  12. ans += 1;
  13. }
  14. else if(c > 1000)
  15. {
  16. break;
  17. }
  18. }
  19. printf("%d",ans);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
2