a059.
完全平方和
| From: [1.161.50.169] |
發表日期
:
2014-01-14 16:40
#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;
}