fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a=1, b=2, c, i, count=0;
  5. for(i=1; c<=1000; i++){
  6. c=3*b+2*a;
  7. b=c;
  8. a=b;
  9. if(c>=100&&c<=1000){
  10. count++;
  11. }
  12. }
  13. printf("%d",count);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
2