diff --git a/750387/main.cpp b/750387/main.cpp new file mode 100644 index 0000000..904c7e2 --- /dev/null +++ b/750387/main.cpp @@ -0,0 +1,33 @@ +#include +using namespace std; + +int main() { + int money[9] , i = 0; + int total = 0 , ans = 0; + float ans0 = 0; + + money[0]=10000; + money[1]=5000; + money[2]=1000; + money[3]=500; + money[4]=100; + money[5]=50; + money[6]=10; + money[7]=5; + money[8]=1; + // + do { + cout << "金額 : "; + cin >> ans0; + } while(ans0 <= 0); + ans = ans0 * 10; + // + do { + total += ans / money[i]; + ans %= money[i]; + i += 1; + //cout << i << " " << total << " " << ans << "\n"; + } while (ans > 0); + // + cout << total << "\n"; +}