# Bangla Numbers 題目連結 [Bangla Numbers](https://onlinejudge.org/external/101/10101.pdf) ## 中文簡述 給一個大數,依照題目給的換算單位輸出,有點像是換零錢的題目。 ## [think] 用遞迴處理 ## solution: ``` #include <bits/stdc++.h> using namespace std; void split(long long n) { if (n >= 10000000) { split(n / 10000000); cout << " kuti"; n %= 10000000; } if (n >= 100000) { split(n / 100000); cout << " lakh"; n %= 100000; } if (n >= 1000) { split(n / 1000); cout << " hajar"; n %= 1000; } if (n >= 100) { split(n / 100); cout << " shata"; n %= 100; } if (n) cout << " " << n; } int main() { long long n; int kase = 1; while (cin >> n) { cout <<setw(4)<< kase++ << "."; if (n) split(n); else cout << " 0"; cout << endl; } return 0; } ``` ###### tags: `UVA` 回目錄 [學習筆記](/gIBZqAbWTCis7uOPp149gA)