a059.
完全平方和
| From: [203.72.60.249] |
發表日期
:
2016-12-19 11:31
#include <stdio.h>
int main(){
int start,end,i,j,time,value;
scanf("%d", &time);
for(i=1;i<=time;i++){
scanf("%d%d", &start,&end);
for(j=1,value=0;(j*j)<=end;j++){
if((start<=j*j)&&(j*j<=end))value=value+j*j;
}
printf("Case %d: %d\n", i,value);
}
return 0;
}