Pabon_SEC

Square Numbers

Sep 3rd, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     long long int a,b,i,c,sum;
  5.     while(scanf("%lld%lld",&a,&b)!=EOF && (a!=0 || b!=0))
  6.     {
  7.         sum=0;
  8.         for(i=1; i<=b; i++)
  9.         {
  10.             c=i*i;
  11.             if(c>=a && c<=b)
  12.             sum++;
  13.         }
  14.         printf("%lld\n",sum);
  15.     }
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment