-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
42 lines (33 loc) · 1010 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <ctype.h>
#include <algorithm>
#include "wordconvertor.h"
bool isNotValid(std::string);
int main() {
std::cout<< "for exit input a non number data \n";
while(1){
std::string nice;
std::cout<<"input a number: ";
std::cin>>nice;
if (isNotValid(nice))
return 0;
neroapp::parser a{nice};
neroapp::WordConvertor Convert;
std::cout<<Convert(a())<<std::endl<<std::endl;
}
return 0;
}
bool isNotValid(std::string Validate_this){
return !std::all_of(Validate_this.begin(),Validate_this.end(),[](char const &c){
return isdigit(c);
});
}
// 1 unu --------------------- +
// 10 zece --------------------- +
// 100 o suta --------------- +
// 1000 o mie --------------- +
// 10 000 zece mii --------------- +
// 100 000 o suta de mii ------- +
// 1000 000 o mie de mii/milion --- +
// 10 000 000 zece mi de mii ------ +
// 100 000 000 o suta mii de mii
// 1 000 000 000 un miliard