#13098: TLE(killed) 跪求大大幫忙


joe631263126312 (unknown)

學校 : 國立嘉義高級中學
編號 : 68323
來源 : [163.27.3.92]
最後登入時間 :
2018-03-26 10:13:45

#include<iostream>
using namespace std;

int main()
{
int t;
cin>>t;
while(t=t)
{
    int a,b,t=0;//t=sum
    cin>>a>>b;
    for(int i=a;i<=b;i++)
    {
        for(int r=0;r<=b;r++)
        {
            if(r*r==i)
                t++;
        }
    }

cout<<t <<endl;

}

return 0;
}
#13102: Re:TLE(killed) 跪求大大幫忙


nkavengertree (LaG)

學校 : 不指定學校
編號 : 62501
來源 : [49.216.191.28]
最後登入時間 :
2021-11-21 03:06:49

#include
using namespace std;

int main()
{
int t;
cin>>t;
while(t=t)
{
    int a,b,t=0;//t=sum
    cin>>a>>b;
    for(int i=a;i<=b;i++)
    {
        for(int r=0;r<=b;r++)
        {
            if(r*r==i)
                t++;
        }
    }

cout<endl;

}

return 0;
}

while( t = t )  ??????
你這邊想要表示的是什麼


如果是等於要用   ==