2151: 【例8.1】人民幣支付 【換行沒寫】

浩瀚宇宙星晨發表於2024-10-18

include <bits/stdc++.h>

using namespace std;
int n;
int main( )
{
cin >> n;
cout << n/100 << endl;
n=n%100;
cout << n/50 << endl;
n=n%50;
cout << n/20 << endl;
n=n%20;
cout << n/10 << endl;
n=n%10;
cout << n/5 << endl;
n=n%5;
cout << n/1 << endl;
n=n%1;
return 0;
}
反思:換行設定忘記寫 << endl;

相關文章