hdu 2028
来源:互联网 发布:中文域名注册管理办法 编辑:程序博客网 时间:2024/06/06 17:49
#include <iostream>#include <cstdio>using namespace std;int a[10010];int gcd(int a, int b){ // 求a, b最大公约数; return (b == 0 ? a : gcd(b, a%b));}int main(){ int n; while(scanf("%d", &n) != EOF){ for(int i = 0; i < n; ++i){ scanf("%d", &a[i]); } int t = a[0]; for(int i = 1; i < n; ++i){ int r = gcd(t, a[i]); t = (t / r * a[i]); //依次求出最小公倍数; } cout << t << endl; } return 0;}
0 0
- HDU 2028
- hdu 2028
- hdu-2028
- HDU 2028
- hdu 2028
- HDU--2028
- HDU-2028
- hdu 2028
- hdu 2028
- HDU--2028
- HDU-2028(最小公倍数)
- hdu oj 2028
- HDU 2028 最小公倍数
- HDU 2028 最小公倍数
- HDU 2028 JAVA
- hdu
- hdu
- HDU
- 6.地址,Block,SEL,多态
- 你是ACM吗?
- 机试算法讲解: 第51题 动态规划之最长公共子序列问题
- [hdoj]1003最大子列和
- UVa 1586 Molar Mass
- hdu 2028
- android 数据存储
- hdu 4027 Can you answer these queries?
- hdu 5112 A Curious Matt
- Unity中的Transform Gizmo中的Pivot和Center
- 循环冗余校验(CRC)算法入门引导
- setsockopt()用法(参数详细说明)
- Jedis - 基本建模图
- windows的socket_tcp服务端与 windows的socket_tcp客服端简单通讯