Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
56 ZRH 百钱买百鸡II C++ Accepted 559 MS 264 KB 537 2022-07-18 03:12:13

Tests(10/10):


Code:

#include<iostream> //输入函数库 #include<iomanip> #include<cmath> //数学函数库 #include<cstdio> #include<ctime> #include<cstring> #include<cstdlib> #include<string> #include<stdlib.h> #include<sys/time.h> using namespace std; int main(){ int x,y,z,n,a=0; cin>>n; for(x=0;x<n;x++){ for(y=0;y<n;y++){ for(z=0;z<n;z++){ if(x+y+z==n&&5*x+3*y+z/3==n&&z%3==0){ a++; cout<<a<<": "<<x<<","<<y<<","<<z<<endl; } } } } if(a==0){ cout<<"None"; } return 0; }