Pages

Saturday, July 30, 2011

a059. 完全平方和


#include
#include
using namespace std;

int main()
{
int n;
cin>>n;
for(int group=0;group {
cout<<"Case "< int a,b,sum=0;
cin>>a>>b;
for(int num=a;num<=b;num++)
{
if( (sqrt(num)*sqrt(num)) == num)
sum += num;
}
cout< }

return 0;
}

No comments:

Post a Comment