Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
57 Benson 百钱买百鸡II C++ Wrong Answer 1 MS 252 KB 508 2022-07-18 03:21:19

Tests(0/10):


Code:

#include<iostream> using namespace std; int main(){ int n,x,y,z,k=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) { k++; cout<<k<<":"<<x<<","<<y<<","<<z<<endl; } } } } if(k==0) { cout<<"None"; } return 0; }


Run Info:

------Input------
100
------Answer-----
1: 0,25,75 2: 4,18,78 3: 8,11,81 4: 12,4,84
------Your output-----
1:0,25,75 2:4,18,78 3:8,11,81 4:12,4,84