Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- enum color {
- RED,
- WHITE,
- BLACK,
- GREEN
- };
- void color22(color type) {
- if (type == RED) {
- system("color 04");
- }
- else if (type == WHITE) {
- system("color 0F");
- }
- else if (type == BLACK) {
- system("color F0");
- }
- else if (type == GREEN){
- system("color 02");
- }
- }
- void print(string stroka) {
- cout << stroka << endl;
- }
- int main(){
- setlocale(LC_ALL, "Russian");
- int a;
- cout << "Выбирете цвет печати" << endl;
- cin >> a;
- string b;
- cout << "Введите текст для печати" << endl;
- cin >> b;
- color type = static_cast<color>(a);
- color22(type);
- print(b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement