Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.91 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int x;
  6.     cin >> x;
  7.     for (int i = 0; i <= 10; ++i) {
  8.         int n = x * i;
  9.         if (x == 1) cout << "u x ";
  10.         if (x == 2) cout << "dos x ";
  11.         if (x == 3) cout << "tres x ";
  12.         if (x == 4) cout << "quatre x ";
  13.         if (x == 5) cout << "cinc x ";
  14.         if (x == 6) cout << "sis x ";
  15.         if (x == 7) cout << "set x ";
  16.         if (x == 8) cout << "vuit x ";
  17.         if (x == 9) cout << "nou x ";
  18.         if (x == 10) cout << "deu x "; 
  19.  
  20.         if (i == 0) cout << "zero = ";
  21.         if (i == 1) cout << "u = ";
  22.         if (i == 2) cout << "dos = ";
  23.         if (i == 3) cout << "tres = ";
  24.         if (i == 4) cout << "quatre = ";
  25.         if (i == 5) cout << "cinc = ";
  26.         if (i == 6) cout << "sis = ";
  27.         if (i == 7) cout << "set = ";
  28.         if (i == 8) cout << "vuit = ";
  29.         if (i == 9) cout << "nou = ";
  30.         if (i == 10) cout << "deu = ";
  31.  
  32.         if (n == 0) cout << "zero" << endl;
  33.  
  34.         if (n > 9 and n < 20) {
  35.             if (n == 10) cout << "deu" << endl;
  36.             if (n%10 == 1) cout << "onze" << endl;
  37.             if (n%10 == 2) cout << "dotze" << endl;
  38.             if (n%10 == 3) cout << "tretze" << endl;
  39.             if (n%10 == 4) cout << "catorze" << endl;
  40.             if (n%10 == 5) cout << "quinze" << endl;
  41.             if (n%10 == 6) cout << "setze" << endl;
  42.             if (n%10 == 7) cout << "disset" << endl;
  43.             if (n%10 == 8) cout << "divuit" << endl;
  44.             if (n%10 == 9) cout << "dinou" << endl;
  45.         }
  46.  
  47.         if (n == 20) cout << "vint" << endl;
  48.         if (n == 30) cout << "trenta" << endl;
  49.         if (n == 40) cout << "quaranta" << endl;
  50.         if (n == 50) cout << "cincuanta" << endl;
  51.         if (n == 60) cout << "seixanta" << endl;
  52.         if (n == 70) cout << "setanta" << endl;
  53.         if (n == 80) cout << "vuitanta" << endl;
  54.         if (n == 90) cout << "noranta" << endl;
  55.         if (n == 100) cout << "cent" << endl;
  56.  
  57.         if (n % 10 != 0) {
  58.             if (n > 20 and n < 30) cout << "vint-i-";
  59.             if (n > 30 and n < 40) cout << "trenta-";
  60.             if (n > 40 and n < 50) cout << "quaranta-";
  61.             if (n > 50 and n < 60) cout << "cinquanta-";
  62.             if (n > 60 and n < 70) cout << "seixanta-";
  63.             if (n > 70 and n < 80) cout << "setanta-";
  64.             if (n > 80 and n < 90) cout << "vuitanta-";
  65.             if (n > 90 and n < 100) cout << "noranta-";
  66.             if (n == 100) cout << "cent";
  67.         }
  68.        
  69.  
  70.         if (n == 1) cout << "u" << endl;
  71.         if (n == 2) cout << "dos" << endl;
  72.         if (n == 3) cout << "tres" << endl;
  73.         if (n == 4) cout << "quatre" << endl;
  74.         if (n == 5) cout << "cinc" << endl;
  75.         if (n == 6) cout << "sis" << endl;
  76.         if (n == 7) cout << "set" << endl;
  77.         if (n == 8) cout << "vuit" << endl;
  78.         if (n == 9) cout << "nou" << endl;
  79.  
  80.         if (n > 20) {
  81.             if (n % 10 == 1) cout << "u" << endl;
  82.             if (n % 10 == 2) cout << "dos" << endl;
  83.             if (n % 10 == 3) cout << "tres" << endl;
  84.             if (n % 10 == 4) cout << "quatre" << endl;
  85.             if (n % 10 == 5) cout << "cinc" << endl;
  86.             if (n % 10 == 6) cout << "sis" << endl;
  87.             if (n % 10 == 7) cout << "set" << endl;
  88.             if (n % 10 == 8) cout << "vuit" << endl;
  89.             if (n % 10 == 9) cout << "nou" << endl;
  90.         }
  91.     }
  92.  
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement