UVa 11461 Square Numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; | |
} |
留言
張貼留言