#include<iostream>
#include<cmath>
#define l unsigned long long int
using namespace std;
int anik(l a, l b)
{
l c = 0, i, j, n;
for(i=a;i<=b;i++)
{
n = sqrt(i);
if(n*n == i)
{
c++;
}
}
return c;
}
int main()
{
l n, m, r;
while(cin >> n >> m)
{
if(n == 0 && m == 0)
break;
r = anik(n, m);
cout << r << endl;
}
return 0;
}
#include<cmath>
#define l unsigned long long int
using namespace std;
int anik(l a, l b)
{
l c = 0, i, j, n;
for(i=a;i<=b;i++)
{
n = sqrt(i);
if(n*n == i)
{
c++;
}
}
return c;
}
int main()
{
l n, m, r;
while(cin >> n >> m)
{
if(n == 0 && m == 0)
break;
r = anik(n, m);
cout << r << endl;
}
return 0;
}
Comments
Post a Comment