

#includeusing namespace std; void printinfor(int x,int y,int z) { cout << "x=" << x << ',' << "y=" << y << ',' << "z=" << z << endl; } int main() { int money=0; while(cin >> money) { for(int i=0; i<=(int)money/5; i++) for(int j=0; j<=(int)money/3; j++) { for(int k=0; k<=3*money; k++) if((i+j+k)==100 && (15*i+9*j+k)<=3*money) printinfor(i,j,k); } } return 0; } /************************************************************** Problem: 1045 User: liuguiyangnwpu Language: C++ Result: Accepted Time:50 ms Memory:1512 kb ****************************************************************/