#include <iostream>
using namespace std;
int main()
{
int t,i,a,b,x[ ] = {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961};
while (cin >> t){
for (int j=1; j<=t; j++){
cin >> a >> b;
int sum =0;
for (int i=0; i<=30; i++){
if (a<=x[i]&&b>=x[i]){
sum += x[i];
}
}
cout << "Case" << " " << j << ':' << " " << sum << endl;
}
}
return 0;
}
#include
using namespace std;
int main()
{
int t,i,a,b,x[ ] = {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961};
while (cin >> t){
for (int j=1; j<=t; j++){
cin >> a >> b;
int sum =0;
for (int i=0; i<=30; i++){
if (a<=x[i]&&b>=x[i]){
sum += x[i];
}
}
cout << "Case" << " " << j << ':' << " " << sum << endl;
}
}
return 0;
}
哇靠你要這樣賭喔
想各種方法都想不到你這種的
超醜超好笑