... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-11461 :: Square Numbers

#include <stdio.h>
#include <math.h>
int main ()
{
     int a,b,n,i ,cnt  ;
     while (scanf ("%d %d",&a,&b) == 2 && a!=0 && b!=0)
     {
          cnt = 0 ;
          for (i=a ; i<=b ; i++)
          {
               n = sqrt (i) ;
               if (n*n == i) cnt++ ;
          }

          printf ("%d\n",cnt) ;
     }

     return 0 ;
}