Advertisement
MasterGun

ty

Apr 11th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. enum color {
  5.  
  6. RED,
  7. WHITE,
  8. BLACK,
  9. GREEN
  10.  
  11. };
  12. void color22(color type) {
  13.  
  14. if (type == RED) {
  15. system("color 04");
  16. }
  17. else if (type == WHITE) {
  18. system("color 0F");
  19. }
  20. else if (type == BLACK) {
  21. system("color F0");
  22. }
  23. else if (type == GREEN){
  24. system("color 02");
  25. }
  26. }
  27. void print(string stroka) {
  28. cout << stroka << endl;
  29. }
  30. int main(){
  31. setlocale(LC_ALL, "Russian");
  32.  
  33. int a;
  34. cout << "Выбирете цвет печати" << endl;
  35. cin >> a;
  36. string b;
  37. cout << "Введите текст для печати" << endl;
  38. cin >> b;
  39. color type = static_cast<color>(a);
  40. color22(type);
  41. print(b);
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement