guozi6

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

#include<iostream>
using namespace std;
int main()
{
int x,y,z;
int a,b,c;
int i;
for(x=0;x<=50;x+=10)
{
for(y=0;y<=50;y+=5)
{
for(z=0;z<=50;z++)
{
if(x+y+z==50)
{
i++;
a=x/10;
b=y/5;
c=z;
cout <<i<<endl;
cout<<"1元:"<<a<<" 5角:"<<b<<" 1角:"<<c<<endl;
}
}
}
}
return 0;
}

 

posted on 2023-05-10 20:24  汀幻  阅读(87)  评论(0编辑  收藏  举报