UVa 11461 Square Numbers

/**
* UVa 11461 Square Numbers
* Author: chchwy
* Last Modified: 2009.11.13
*/
#include<cstdio>
#include<cmath>
int main()
{
int a, b;
while (scanf("%d %d", &a, &b) == 2 )
{
if (!a) break;
int counter = 0;
int i = ceil(sqrt(a));
while ( i * i <= b )
{
counter++, i++;
}
printf("%d\n", counter);
}
return 0;
}
view raw 11461.cpp hosted with ❤ by GitHub

留言

這個網誌中的熱門文章

UVa 10125 Sumsets

讀書心得: 撒哈拉的故事

讀書心得: 你以為你以為的就是你以為的嗎?