#include <iostream> #include <string> #include <cmath> using namespace std ; int main (void) { { cout<<"Please enter total money " ; } int money; int B1000; int B500; int B100; int B50; int B20; int C10; int C5; int C2; int C1; cin>>money; if(money>=1000) { B1000=money/1000; money=money%1000; cout<<"Bank_1000 baht = "<<B1000<<" bill"<< "\n"; } if(money>500) { B500=money/500; money=money%500; cout<<"Bank_500 baht = "<<B500<<" bill"<<"\n"; } if(money>100) { B100=money/100; money=money%100; cout<<"Bank_100 baht = "<<B100<<" bill"<<"\n"; } if(money>50) { B50=money/50; money=money%50; cout<<"Bank_50 baht = "<<B50<<" bill"<<"\n"; } if(money>20) { B20=money/20; money=money%20; cout<<"Bank_20 baht = "<<B20<<" bill"<<"\n"; } if(money>10) { C10=money/10; money=money%10; cout<<"Coins_10 baht = "<<C10<<" Coins"<<"\n"; } if(money>5) { C5=money/5; money=money%5; cout<<"Coins_5 baht = "<<C5<<" Coins"<<"\n"; } if(money>2) { C2=money/2; money=money%2; cout<<"Coins_2 baht = "<<C2<<" Coins"<<"\n"; } if(money>=1) { C1 = money/1; money = money%1; cout<<"Coins_1 baht = "<<C1<<" Coins"; } else { money < 0; cout<<"finished "; } system("pause>nul"); return 0; }
#include <iostream> #include <string> #include <cmath> #include <iomanip> using namespace std ; int main (void) { { cout<<"Please enter total money " ; } int money; int B1000; int B500; int B100; int B50; int B20; int C10; int C5; int C2; int C1; cin>>money; if(money>=1000) { B1000=money/1000; money=money%1000; cout<<"Bank1000 baht = "<<B1000<<" bill"<< "\n"; } if(money>500) { B500=money/500; money=money%500; cout<<"Bank500 baht = "<<B500<<" bill"<<"\n"; } if(money>100) { B100=money/100; money=money%100; cout<<"Bank100 baht = "<<B100<<" bill"<<"\n"; } if(money>50) { B50=money/50; money=money%50; cout<<"Bank50 baht = "<<B50<<" bill"<<"\n"; } if(money>20) { B20=money/20; money=money%20; cout<<"Bank20 baht = "<<B20<<" bill"<<"\n"; } if(money>10) { C10=money/10; money=money%10; cout<<"Coins10 baht = "<<C10<<" Coins"<<"\n"; } if(money>5) { C5=money/5; money=money%5; cout<<"Coins5 baht = "<<C5<<" Coins"<<"\n"; } if(money>2) { C2=money/2; money=money%2; cout<<"Coins2 baht = "<<C2<<" Coins"<<"\n"; } if(money>=1) { C1 = money/1; money = money%1; cout<<"Coins1 baht = "<<C1<<" Coins"; } if( money2>=0.5 ) { c1 = 1; money2=money2-0.50; cout<<"c0.50 : "<<c1<<" coins "<<"\n"<<"\n"; } if( money2>=0.25 ) { c1 = 1; money2=money2-0.25; cout<<"c0.25 : "<<c1<<" coins "<<"\n"<<"\n"; } { cout <<"//-- Thank you --//"; } system ("pause>nul"); return 0; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง