Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #include<cmath>
- using namespace std;
- int main()
- {
- double d;
- int a, b;
- while(scanf("%d%d", &a, &b) && ( a>0 && b>0)){
- int c=0;
- if( a>b){ int temp;
- temp=a;
- a=b;
- b=temp;
- }
- for(int i=a;i<=b;i++){
- d=sqrt(i);
- if(d==int(d)){
- c++;
- }
- }
- printf("%d\n",c);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement