Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int cislo = 0;
- cin >> cislo;
- string cisla[] = { "","jeden", "dva", "tri","styri", "pet", "sest","sedem","osem","deved" };
- int tempCislo = cislo;
- int digits = 0; do { tempCislo /= 10; digits++; } while (tempCislo != 0);
- cout << digits << endl;
- int tempCislo3 = cislo;
- int len = 0;
- int cislaArr[digits - 1];
- //2
- //13
- //158
- //1459
- for(int i = 0; i < digits; i++)
- {
- int ciss = tempCislo3 % 10;
- tempCislo3 /= 10;
- cislaArr[3 - i] = ciss;
- }
- for(int i = 0; i < digits; i++)
- {
- int cislica = cislaArr[i];
- //1000
- if((digits - i) == 4)
- {
- len += 5;
- if(cislica != 1)
- {
- //tisic
- len += 5;
- len += cisla[cislica].length();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement