Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main(void)
- {
- int num,c1,c2;
- string u[] = {"zero", "uno" , "due", "tre", "quattro", "cinque", "sei", "sette", "otto", "nove" };
- string d[] = {"dieci", "undici", "dodici", "tredici", "quattordici", "quindici", "sedici", "diciassette", "diciotto", "diciannove"};
- string nd[] = {"venti", "trenta", "quaranta", "cinquanta", "sessanta", "settanta", "ottanta", "novanta"};
- cout << "Inserire numero in cifre:(0-99)" << endl;
- cin >> num;
- c1 = (num / 10);
- c2 = num - (c1 * 10);
- /**********************************************************************/
- if (num < 10)
- cout << u[num] << endl;
- else
- if (num > 10 && num < 20)
- cout << d[c2] << endl;
- else
- if (num > 20 && num < 100)
- cout << nd[c1 - 2] << u[c2] << endl;
- else
- cout << "Valore non valido! " << endl;
- /**********************************************************************/
- system("pause >>null");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement