Run ID:97523

提交时间:2024-11-16 10:20:53

#include<bits/stdc++.h> using namespace std; int main(){ int n,s = 1; cin>>n; for (int x = 0;x <= n / 5;x++){ for (int y = 0;y <= n / 3;y++){ for (int z = 0;z <= n / 1;z++){ if(x+y+z == n && 5*x+3*y+z/3==n&&z%3==0){ cout<<s<<":"<<" "<<x<<","<<y<<","<<z<<endl; s++; } } } } if (s == 1){ cout<<"None"; } return 0; }