SHARE
TWEET

Untitled

a guest Jul 17th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. void cls() {
  6. #if defined(_WIN32)
  7.     system("cls");
  8. #elif defined(linux)
  9.     system("clear");
  10. #endif
  11. }
  12.  
  13. void wait() {
  14. #if defined(_WIN32)
  15.     system("pause");
  16. #elif defined(linux)
  17.     system("sleep 3");
  18. #endif
  19. }
  20.  
  21. int main() {
  22.     int i, j, l, w;
  23.     char c;
  24.     while (1) {
  25.         cls();
  26.         cout <<
  27.         "Drawing with batch.." << endl << endl <<
  28.         "Length >> ";
  29.         cin >> l;
  30.         cout << "Width >> ";
  31.         cin >> w;
  32.         cout << "Empty Space >> ";
  33.         cin >> c;
  34.         cls();
  35.         for (i = 0; i < l; i++) {
  36.             for (j = 0; j < w; j++)
  37.                 cout << c;
  38.             cout << endl;
  39.         }
  40.         wait();
  41.     }
  42. }
RAW Paste Data
Top