fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4.  
  5.  
  6. int main()
  7. {
  8.  
  9. int start,stop,sum=0,Min;
  10. scanf("%d%d",&start,&stop);
  11. char *s1=malloc(sizeof(int)*(stop-start));
  12.  
  13. for(int i=start;i<=stop;i++)
  14. {
  15. for(int j=0;j<=stop;j++)
  16. {
  17. if(pow(j,2)==i)
  18. {
  19. s1[i]=j;
  20. sum+=i;
  21.  
  22. }
  23.  
  24. }
  25.  
  26. }
  27.  
  28.  
  29. for(int z=stop;z>=start;z--)
  30. {
  31. if(s1[z]!=0)
  32. Min=z;
  33.  
  34. }
  35.  
  36.  
  37.  
  38. printf("%d\n%d",sum,Min);
  39.  
  40.  
  41.  
  42. free(s1);
  43.  
  44. return 0;
  45. }
Success #stdin #stdout 0s 9424KB
stdin
65
72
stdout
0
-1066235760