UVA 11461 - Square Numbers

UVA Sep 1, 2020

Problem PDF

Solution:

#include 
#include 
int main()
{
    int t,a,b,c,i,d;
    while(scanf("%d %d", &a, &b)==2)
    {
        if(a==0&&b==0)
        break;
        d=0;
        for(i=a;i<=b;i++)
        {
           c=sqrt(i);
           if(c*c==i)
           d++;
        }
        printf("%d\n", d);
    }
return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11461/11461.cpp

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.