您的位置:首页 > 其它

百练oj 4146:数字方格

2017-04-05 15:27 295 查看
//@auther zhou
//@Number 201408070203
//@start time:
//@finish time:
/*@此处注意:

*/
/* 测试数据

*/
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
int n;
cin>>n;
int m=0;
for(int a2=n;a2>=0;a2--){
for(int a3=n;a3>=0;a3--){
if((a2+a3)%3==0){
for(int a1=n;a1>=0;a1--){
if(((a1+a2+a3)%5==0)&((a1+a2)%2==0)){
m=max(m,a1+a2+a3);
}
}
}

}
}
cout<<m;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: