/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved
*文件名称:test.cpp
*作者:吴雨凡
*版本:v6.0
*
*问题描述:换分币
*输入描述:
*程序输出:判断相关问题
*/
- #include<iostream>
- using namespace std;
- int main()
- {
- int i,j,k,count=0;
- for(i=0;i<=100;i++)
- for(j=0;j<=50;j++)
- for(k=0;k<=20;k++)
- {
- if(i+j*2+k*5==100)
- {
- ++count;
- cout<<"第"<<count<<"种";
- cout<<" "<<"1分钱:"<<i;
- cout<<" "<<"2分钱:"<<j;
- cout<<" "<<"5分钱:"<<k<<endl;
- if(count%50==0) //每输出50个方案暂停一次
- {
- cout<<"按任意键继续输出"<<endl;
- getchar();
- }
- }
- }
- return 0;
- }