#6276: c++求助~~


kevin898y (我不會寫程式~~)


我自己測都對 可我放上去就錯 可幫我看一下程式碼嗎?

#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int a,c,d,f=0;
    cin>>a;
    for(int b=1;b<=a;b++)
    {
        cin>>c>>d;
        f=0;
        for(float e=c;e<=d;e++)
        {
            if((sqrt(e))*(sqrt(e))==e )
            {
                f+=e;
            }
        }
        cout<<"Case "<<b<<": "<<f<<endl;
    }

    return 0;
}