蓝桥杯 算法训练 ALGO-2 最大最小公倍数
2016-02-09 23:29
681 查看
#include<iostream> using namespace std; int main() { long long ans; long long n; while( scanf("%lld",&n)!=EOF ) { if(n<=2) { printf("%lld\n",n); } else if(n%2==1) { ans=n*(n-1)*(n-2); printf("%lld\n",ans); } else { if(n%3==0) { ans=(n-1)*(n-2)*(n-3); printf("%lld\n",ans); } else { ans=n*(n-1)*(n-3); printf("%lld\n",ans); } } } return 0; }
相关文章推荐
- Django 笔记 模型数据的读取
- Django 笔记 模型数据的读取
- google推出的SwipeRefreshLayout下拉刷新用法
- hdu acm 1533 Going Home
- 104. Maximum Depth of Binary Tree LeetCode
- 蓝桥杯 算法训练 ALGO-1 区间k大数查询
- 什么是感知器学习算法(Perceptron Learning Algorithm/PLA)?
- mongoose 文档(五) Validation
- 为GoLang增加aes的ECB模式支持
- Django 笔记 manage.py sync 错误
- Django 笔记 manage.py sync 错误
- go语言入门的资料
- FFmpeg的添加logo,去logo
- STL algorithm算法is_permutation(27)
- nyist 297 GoroSort
- Moore's majority vote algorithm
- Django 模型
- Django 模型
- algorithm@ find kth smallest element in two sorted arrays (O(log n time)
- mongo配置文件