opyright (c) 2013, Yantai University School of computer students *all rights r
Eserved.
* File name: Convert one dollar to 1 points, five points, two points possible results * Author: Yang Fei * completion date: December 21, 2013
* Version Number: v1.0
* Description of the task and solution method part: The possible results of the conversion of one dollar to 1 points, five points, two points #include <iostream> using namespace std;
int main () {int x,y,z,count=0;
cout<< "money-exchanging scheme:" <<endl; for (x=0; x<=100; x + +) for (y=0, y<=50; y++) for (z=0; z<=20; z++) if (x+2*y+5*z==100
) {count++;
cout<<count<< "one point" <<x<< "two points" <<y<< "Five Points" <<z<<endl;//output scheme}
cout<< "A total of" <<count<< "possibilities" <<endl;
return 0; }
Operation Result:
Experience: There are too many possibilities, cut the last figure