【HDOJ】【1017】A Mathematical Curiosity
来源:互联网 发布:java开发的工作内容 编辑:程序博客网 时间:2024/06/06 05:53
被格式坑得飞起,看了好久好久才通过。
代码显得比较low,还可以继续进行优化。
#include <stdio.h>#include <stdlib.h>#include <string.h>/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) {int N,n,m,CaseNum,a,b,count;float tmp;while(scanf("%d",&N)!=EOF){while(N--){CaseNum = 0;while(scanf("%d%d",&n,&m)!=EOF){if(n==0 && m==0)break;{count = 0;for(b = n-1;b>1;b--){for(a=1;a<b;a++){tmp = (float)(a*a+b*b+m)/(a*b);if((int)tmp == tmp){count++;}}}printf("Case %d: %d\n",++CaseNum,count);}}if(N)printf("\n");}}system("PAUSE");return 0;}
0 0
- HDOJ 1017 A Mathematical Curiosity
- HDOJ 1017 A Mathematical Curiosity
- hdoj 1017 A Mathematical Curiosity
- hdoj 1017 A Mathematical Curiosity
- HDOJ 1017 A Mathematical Curiosity
- hdoj 1017 A Mathematical Curiosity
- HDOJ 1017 A Mathematical Curiosity
- 【HDOJ】【1017】A Mathematical Curiosity
- HDOJ 1017 A Mathematical Curiosity
- hdoj 1017-A Mathematical Curiosity
- HDOJ 1017-A Mathematical Curiosity
- HDOJ 1017 A Mathematical Curiosity
- HDOJ A Mathematical Curiosity
- HDOJ 1017 A Mathematical Curiosity解题报告
- hdoj.1017 A Mathematical Curiosity 20140728
- 1017 A Mathematical Curiosity
- 1017 A Mathematical Curiosity
- 1017 A Mathematical Curiosity
- Apache配置tomcat集群
- mongo bulk批量更新
- HBase tableExists() 作用就是判断某个表是否存在
- 错误整理(一)使用 JSTL 标签出现警告
- 解决数据库连接报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)问题
- 【HDOJ】【1017】A Mathematical Curiosity
- stormzhang
- linux 下安装 pcre
- ARM开发板上交叉编译usb转串口驱动
- DLL 导出类
- JSON工具类
- VBS脚本运行后删除自身的方法
- ubuntu下对php环境的配置步骤
- Tomcat内存优化4 求根索源——工具 JVM性能调优监控工具jps、jstack、jmap、jhat、jstat、hprof使用详解