fork download
  1. #include <stdio.h>
  2.  
  3. int count(int n)
  4. {
  5. if(n==1)
  6. return 4;
  7. int b=1,s=1,pb,ps;
  8. for(int i=2;i<=n;i++)
  9. {
  10. pb=b;
  11. ps=s;
  12. s=pb+ps;
  13. b=ps;
  14. }
  15. int res=b+s;
  16. return (res*res);
  17. }
  18.  
  19. int main()
  20. {
  21. int n=6;
  22. int c=count(n);
  23. printf("%d",c);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
441