File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
#include < cstring>
3
- using namespace std ;
4
3
5
4
const char RED[8 ]=" \033 [0;31m" ;
6
5
const char GREEN[8 ]=" \033 [0;32m" ;
@@ -33,17 +32,17 @@ int main()
33
32
}
34
33
35
34
void print_start_message (){
36
- cout<<" Select a color" <<endl;
37
- cout<<RED<<OPTION_RED<<" ) red" <<NO_COLOR<<endl;
38
- cout<<GREEN<<OPTION_GREEN<<" ) green" <<NO_COLOR<<endl;
39
- cout<<YELLOW<<OPTION_YELLOW<<" ) yellow" <<NO_COLOR<<endl;
35
+ std:: cout<<" Select a color" <<std:: endl;
36
+ std:: cout<<RED<<OPTION_RED<<" ) red" <<NO_COLOR<<std:: endl;
37
+ std:: cout<<GREEN<<OPTION_GREEN<<" ) green" <<NO_COLOR<<std:: endl;
38
+ std:: cout<<YELLOW<<OPTION_YELLOW<<" ) yellow" <<NO_COLOR<<std:: endl;
40
39
}
41
40
42
41
int get_option (){
43
42
int option=0 ;
44
43
do {
45
44
print_start_message ();
46
- cin>>option;
45
+ std:: cin>>option;
47
46
} while (option==0 || option > OPTION_YELLOW);
48
47
return option;
49
48
}
@@ -67,6 +66,6 @@ void print_message_with_color(int selectedColor) {
67
66
break ; // useless but usefull when needed to put antother option
68
67
}
69
68
70
- cout<<color_to_print<<" Hello Colored World" <<NO_COLOR<<endl;
71
- cout<<NO_COLOR;
69
+ std:: cout<<color_to_print<<" Hello Colored World" <<NO_COLOR<<std:: endl;
70
+ std:: cout<<NO_COLOR;
72
71
}
You can’t perform that action at this time.
0 commit comments