#include<iostream>
using namespace std;
int main ()
{
cout<<"*** 智慧找零系統 ***";
int x,y,z,k;
cout<<"請輸入商品價格:";
cin >> x;
cout<<"客人付了多少錢:";
cin >> y;
z=y-x;
cout<<"須找客人"<<z<<"元"<<endl;
k = z / 500;
z = z % 500;
cout <<"500元的"<<k<<"張"<<endl;
k = z / 100;
z = z % 100;
cout <<"100元的"<<k<<"張"<<endl;
k = z / 50;
z = z % 50;
cout <<"50元的"<<k<<"枚"<<endl;
k = z / 10;
z = z % 10;
cout <<"10元的"<<k<<"枚"<<endl;
k = z / 5;
z = z % 5;
cout <<"5元的"<<k<<"枚"<<endl;
k = z / 1;
z = z % 5;
cout <<"1元的"<<k<<"枚"<<endl;
system("pause");
return 0;
}