HDU 2503.a/b + c/d
来源:互联网 发布:爱奇艺网络电影排行榜 编辑:程序博客网 时间:2024/06/10 10:59
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2503
AC代码(C++):
#include <iostream>#include <algorithm>#include <stdio.h>#include <vector>#include <queue>#include <map>#include <math.h>#include <string>#include <string.h>#include <bitset>#define INF 0xfffffff#define MAXN 100105using namespace std;int gcd(int a, int b){ if(b==0)return a; return gcd(b,a%b);}int main(){ int t; cin>>t; int a,b,c,d,e,f; while(t--){ cin>>a>>b>>c>>d; f = b*d; e = a*d + c*b; int GCD = gcd(e,f); e/=GCD; f/=GCD; cout<<e<<' '<<f<<endl; }}总结: 水题.
阅读全文
0 0
- HDU 2503.a/b + c/d
- HDU 2503 a/b + c/d
- hdu-2503-a/b + c/d
- HDU 2503 a/b + c/d
- hdu 2503 a/b+c/d
- hdu-2503-a/b + c/d
- HDU-2503-a/b + c/d
- hdu 2503 a/b + c/d
- HDU 2503 a/b + c/d
- HDU 2503 a/b + c/d
- a+++b+c+++d++
- a/b + c/d
- hdu 2503 a/b + c/d(水)
- hdu 2503 欧几里得水题 化简 a/b + c/d
- HDU-2503 a/b + c/d 水题 GCD
- 杭电(hdu)ACM 2503 a/b + c/d
- HDU 2503 a/b + c/d(水~)
- HDOJ(HDU) 2503 a/b + c/d(最大公约数问题)
- 原生PHP
- vld配置 应用程序正常初始化 0x0150002失败 bug解决记录
- 预习进程间通信方式1
- debug经验
- C笔试题
- HDU 2503.a/b + c/d
- 《计算机程序的构造和解释(第2版)》【PDF】下载
- Python Flask 学习笔记
- C#使用APlayer开发自制媒体播放器
- MVC和三层架构
- MySQL悲观锁
- 链栈的操作
- Vue2.0 使用vue-resource 模拟网络请求加载本地数据
- oracle 获取中文中的数字、字符串中的数字