UVA11461- Square Numbers
来源:互联网 发布:中国cms哪个好 编辑:程序博客网 时间:2024/06/15 04:35
题目链接
题意:求a到b之间的平方数的数量
思路:暴力,水题
代码:
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int MAXN = 100005;int vis[MAXN];int judge(int n) { double a = sqrt((double)n); int b = (int)a; if (a - b < 1e-6) return true; return false;}int main() { int a, b; while (scanf("%d%d", &a, &b) && (a || b)) { memset(vis, 0, sizeof(vis)); int cnt = 0; for (int i = a; i <= b; i++) { if (judge(i)) { cnt++; } } printf("%d\n", cnt); } return 0;}
0 0
- Uva11461 Square Numbers
- UVA11461- Square Numbers
- uva11461
- Square Numbers(Square Numbers)
- BNU - Square-Free Numbers
- UVa 11461 - Square Numbers
- uva 11461 Square Numbers
- UVA - 11461 Square Numbers
- UVa 11461 - Square Numbers
- UVA 11461-Square Numbers
- uva 11461Square Numbers
- Sum of Square Numbers
- UVa OJ 11461-Square Numbers
- [3_3_range] counting square numbers
- uva 11461 - Square Numbers(数论)
- UVA 11461 K - Square Numbers
- 633. Sum of Square Numbers
- 633. Sum of Square Numbers
- 企业级标准加载器 ESL的配置
- UBOOT之源码分析(X4412)——板级初始化
- android handler 理解
- 通过iText将html转换成pdf中文乱码问题
- C++改错
- UVA11461- Square Numbers
- Sqlite所作增删改查示例
- vc里面关于"\"的用法
- 黑马程序员-11.OC的内存管理和block、protocol
- 毕业师兄的科研忠告
- Chord算法(原理)
- 白话经典算法系列之五 归并排序的实现
- ant
- tomcate设置数据源和连接池