# Square numbers 題目連結 [UVA 11461](https://onlinejudge.org/external/114/11461.pdf) ## 中文簡述 給你兩個數,計算中間有幾個完全平方數 ## [think] 這題很簡單,只要先開a和B的平方根,在相減就好了 ## solution: ``` #include<bits/stdc++.h> using namespace std; int main() { int a,b,i; while(cin>>a>>b) { if(a==0 and b==0) { break; } else { a=floor(pow(a,0.5)); b=floor(pow(b,0.5)); //cout<<" "<<b<<" "; cout<<b-a+1<<endl; //cout<<i; } } } ``` ###### tags: `UVA` 回目錄 [學習筆記](/gIBZqAbWTCis7uOPp149gA)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up