华东交通大学2016届新生选拔赛:1010 我是签到题
2016-12-11 16:57
363 查看
我是签到题
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 35 Accepted Submission(s) : 16
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
Input
多组输入,每组输入三个正整数a,b,c(1<=a,b,c<=50000)。
Output
输出a,b,c三个数的最小公倍数。
Sample Input
1 2 3
Sample Output
6
代码:
#include<iostream> #include<algorithm> #include<cstring> #include<cctype> #include<cstdio> #include<set> #include<cmath> #include<string> using namespace std; long long gcd(long long a, long long b){ long long temp; while(b){ temp = a; a = b; b = temp % a; } return a; } int main(){ long long a, b, c, x; while(~scanf("%lld %lld %lld", &a, &b, &c)){ x = a / gcd(a, b) * b; printf("%lld\n", x / gcd(x, c) * c); } return 0; }
相关文章推荐
- 华东交通大学2016届新生选拔赛:1001 最大的空地
- 华东交通大学2016届新生选拔赛:1002 二进制
- 华东交通大学2016届新生选拔赛:1003 Vitya in the Countryside
- 华东交通大学2016届新生选拔赛:1004 扑克牌
- 华东交通大学2016届新生选拔赛:1006 我是大水题哦
- 华东交通大学2016届新生选拔赛:1008 消消乐
- 华东交通大学2016届新生选拔赛:1009 pyw的贪心问题
- 2015NCHU第一届ACM新生选拔赛赛题说明
- JXNU 新生选拔赛
- 2015苏州大学ACM-ICPC集训队选拔赛(2) 1001 1003 1010
- 新生集训选拔赛
- 遍地橘子(湖南科技大学2014新生选拔赛)
- 华东交通大学2016年ACM“双基”程序设计竞赛 1010
- 2016Hrbust软件学院ACM新生选拔赛(一)
- 2011新生选拔赛解题报告
- 2015NCHU第一届ACM新生选拔赛A题题解
- 2015NCHU第一届ACM新生选拔赛B题题解
- 2015NCHU第一届ACM新生选拔赛C题题解
- 新生选拔赛一
- 2015NCHU第一届ACM新生选拔赛D题题解