HDOJ 2080 Lowest Common Multiple Plus
2015-07-20 21:18
281 查看
http://acm.hdu.edu.cn/showproblem.php?pid=2028
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
int main()
{
int n;
int i;
int a[100];
int tem;
while(~scanf("%d",&n))
{
tem=0;
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
tem=tem>a[i]?tem:a[i];
}
for(i=1;i<=n;i++)
{
if(tem%a[i]!=0)
{
tem++;
//i=1;
i=0;
}
}
printf("%d\n",tem);
}
return 0;
}
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
int main()
{
int n;
int i;
int a[100];
int tem;
while(~scanf("%d",&n))
{
tem=0;
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
tem=tem>a[i]?tem:a[i];
}
for(i=1;i<=n;i++)
{
if(tem%a[i]!=0)
{
tem++;
//i=1;
i=0;
}
}
printf("%d\n",tem);
}
return 0;
}
相关文章推荐
- 【Spark Core】任务执行机制和Task源码浅析2
- Linux下inotify的基本使用及注意事项
- 字符设备驱动之从用户程序中的系统调用到驱动中的具体实现
- [leedcode 102] Binary Tree Level Order Traversal
- 九度oj 1052
- C#的开始
- (七十八)使用第三方框架INTULocationManager实现定位
- java 设计模式 工厂模式
- Qt中show()与exec()
- POJ2966时区时间转换
- 【Spark Core】任务执行机制和Task源码浅析1
- (七十八)使用第三方框架INTULocationManager实现定位
- 栈
- 转:Redis Geo: Redis新增位置查询功能
- 堆排序
- [DFS] AOJ 0033 Ball
- 类和对象、封装和继承
- 奇偶剪枝
- Codeforce219C——贪心——Color Stripe
- POJ 3261 Milk Patterns sa+二分