Q11461: Square Numbers

// Accepted !!

#include <stdio.h>
#include <cstdlib>
#include <math.h>

using namespace std;

int main()
{
    int a, b;

    while(scanf("%d%d",&a, &b) != EOF)
    {
        if(a == 0 && b == 0)
            break;
        printf("%d\n",int(floor(sqrt(b))-floor(sqrt(a-1))));
    }
    system("PAUSE");
    return EXIT_SUCCESS;
}

Leave a Reply