HDU 1017
2016-05-16 09:46
351 查看
题目:HDU1017 A Mathmatical Curiosity
题目分析:水题。重点是输入输出格式。
题目分析:水题。重点是输入输出格式。
#include<stdio.h> #include<string.h> #include<iostream> using namespace std; int main() { int n,m,N; scanf("%d",&N); while(N--){ int Case=0; while (scanf("%d%d",&n,&m),n||m) { int Count =0; int a=0,b=0; int temp=0; for( b=2;b<n;++b) for( a=1;a<n;++a){ temp=(a*a+b*b+m)%(a*b); if( temp== 0 && a<b) Count++; } Case++; cout<<"Case "<<Case<<":"<<" "<<Count<<endl; } if(N) cout<<endl; } return 0; }
相关文章推荐
- NUI四种提交数据方式c
- 怎样在Swift中使用CocoaPods
- ios运行某些工程时屏幕上下出现黑边的解决办法
- [Linux]CentOS下安装和使用tmux
- 机器学习算法一览表附opencv机器学习模块
- 6.Redis持久化--主从同步
- 深入理解 Comparable 接口和 Comparator 接口以及Arrays.sort()
- PHP 程序员的技术成长规划
- java 面向对象三大特性(封装,继承,多态)以及抽象、接口的介绍
- Spark性能优化第三季
- Hibernate动态条件查询(Criteria Query)
- 转:Redis使用认证密码登录
- 戴尔PowerEdge R730 机架式服务器安装 Ubuntu 14.04.3 LTS
- 详实的SQL学习笔记
- python 套接字简单服务器端
- 通过IMAP方式迁移U-Mail邮件到Exchange 2013之2008R2 AD搭建!
- Common Lisp入门笔记(五)书后习题
- 经纬度坐标转为上海地方坐标代码(js代码)
- SHA256兼容性
- 党课心得五(杂谈)