Sunday, May 14, 2017

uva online judge 11461

UVa online judge
problem: 11461

problem link:



solution:


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c;
    double d;
    for(int i=0;;i++)
    {
        scanf("%d%d",&a,&b);
        if(a==0&&b==0) break;
        int cnt=0;
        for(int j=a;j<=b;j++)
           {
               c=sqrt(j);d=sqrt(j); if(c==d)cnt++;
           }
        printf("%d\n",cnt);
    }
    return 0;
}

No comments:

Post a Comment