Run ID:7006
提交时间:2025-03-29 15:37:07
#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 n,d=0,z=0; cin>>n; for(int x=0;x<=n/5;x++){ for(int y=0;y<=n/3;y++){ z=n-x-y; if(x*5+y*3+z/3==n&&x+y+z==n&&x%3==0){ d++; cout<<d<<": "<<x<<","<<y<<","<<z<<endl; } } } if(d==0){ cout<<"none"; } return 0; }