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