Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136103 顾文博 百钱买百鸡II C++ Accepted 2 MS 276 KB 554 2025-11-09 15:35:02

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int x,y,z,n,a=1; cin>>n; for(int x=0;x<=n;x++){ y=(n-7*x)/4; z=6*x+3*y; if(x>=0 && y>=0 && z>=0 && x+y+z==n){ cout<<a<<": "<<x<<','<<y<<','<<z<<endl; a++; } } if(a==1){ cout<<"None"; } return 0; }