#include<iostream.h>
int main( void )
{
char st;
int pay,a,b,c,d,e,f,g,h,i,j,k,input = 0 ;
float z;
bool replay = false ;
do {
cout << "購物(1:購物 0:滾)?" ;
cin >> st;
} while ( replay) ;
cout << "買" ; cin >> z;
if ( z>= 900 )
z= z* 0.8 ;
else if ( z>= 500 )
z= z* 0.9 ;
else
z= z* 0.95 ;
cout << "應付金額" << z<< endl;
cout << "付" ; cin >> pay;
a= pay- ( int ) z;
if ( a< 0 )
cout << "錯誤 \n " ;
else
{
b= a/ 500 ; c= a% 500 ;
d= c/ 100 ; e= c% 100 ;
f= e/ 50 ; g= e% 50 ;
h= g/ 10 ; i= g% 10 ;
j= i/ 5 ; k= i% 5 ;
cout << "找零=" << a<< endl;
cout << "500*" << b<< endl<< "100*" << d<< endl<< "50*" << f<< endl<< "10*" << h<< endl
<< "5*" << j<< endl<< "1*" << k<< endl;
}
cin >> st;
}
I2luY2x1ZGU8aW9zdHJlYW0uaD4KaW50IG1haW4odm9pZCkKewogICAgY2hhciBzdDsKICAgIGludCBwYXksYSxiLGMsZCxlLGYsZyxoLGksaixrLGlucHV0ID0gMDsKICAgIGZsb2F0IHo7CiAgICBib29sIHJlcGxheSA9IGZhbHNlOwogICAgZG8gewogICAgICAgIGNvdXQgPDwgIuizvOeJqSgxOuizvOeJqSAwOua7vinvvJ8iOwogICAgICAgIGNpbiA+PiBzdDsKICAgIH0gd2hpbGUocmVwbGF5KTsKICAgIGNvdXQ8PCLosrciO2Npbj4+ejsKICAgIGlmKHo+PTkwMCkKICAgIHo9eiowLjg7CiAgICBlbHNlIGlmICh6Pj01MDApCiAgICB6PXoqMC45OwogICAgZWxzZQogICAgej16KjAuOTU7CiAgICBjb3V0PDwi5oeJ5LuY6YeR6aGNIjw8ejw8ZW5kbDsKICAgIGNvdXQ8PCLku5giO2Npbj4+cGF5OwogICAgYT1wYXktKGludCl6OwogICAgaWYgKGE8MCkKICAgIGNvdXQ8PCLpjK/oqqQgXG4iOwogICAgZWxzZQogICAgewogICAgYj1hLzUwMDtjPWElNTAwOwogICAgZD1jLzEwMDtlPWMlMTAwOwogICAgZj1lLzUwO2c9ZSU1MDsKICAgIGg9Zy8xMDtpPWclMTA7CiAgICBqPWkvNTtrPWklNTsKICAgIGNvdXQ8PCLmib7pm7Y9Ijw8YTw8ZW5kbDsKICAgIGNvdXQ8PCI1MDAqIjw8Yjw8ZW5kbDw8IjEwMCoiPDxkPDxlbmRsPDwiNTAqIjw8Zjw8ZW5kbDw8IjEwKiI8PGg8PGVuZGwKICAgIDw8IjUqIjw8ajw8ZW5kbDw8IjEqIjw8azw8ZW5kbDsKfQogICAgY2luPj5zdDsKfQ==
compilation info
prog.cpp:1:21: error: iostream.h: No such file or directory
prog.cpp: In function ‘int main()’:
prog.cpp:9: error: ‘cout’ was not declared in this scope
prog.cpp:10: error: ‘cin’ was not declared in this scope
prog.cpp:12: error: ‘cout’ was not declared in this scope
prog.cpp:12: error: ‘cin’ was not declared in this scope
prog.cpp:19: error: ‘endl’ was not declared in this scope
prog.cpp:5: warning: unused variable ‘input’
stdout