Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <stdlib.h>
  4. using std::cout;
  5. using std::cin;
  6. using std::endl;
  7.  
  8. #define AlphabetSIZE 36
  9. #define White 15
  10. #define Green 2
  11. #define SymbolsSIZE 8
  12.  
  13. char Alphabet[] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'};
  14. char Symbol[] = {'!','@','#','$','%','&','=','+'};
  15.  
  16. int main()
  17. {
  18.     short int c;
  19.     short int f;
  20.     char input;
  21.     short int counter = 0;
  22.     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),Green);
  23.     while(1)
  24.     {
  25.         for(int i=0; i<AlphabetSIZE;i++)
  26.         {
  27.             c = rand() % AlphabetSIZE;
  28.             f = rand() % SymbolsSIZE;
  29.             cout << Alphabet[c];
  30.             if(counter %20 == 0)
  31.             {
  32.                 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),White);
  33.                 cout << Symbol[f];
  34.             }
  35.             SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),Green);
  36.             counter = counter + 1;
  37.         }
  38.         cout << "\n";
  39.     }
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement