Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <windows.h>
  4. #include <ctime>
  5. #include <cstdlib>
  6.  
  7. using namespace std;
  8.  
  9. void postavi_kurzor(short x, short y) //funkcija se postavi na željeno vrstico in stolpec
  10. {   HANDLE hStdout=GetStdHandle(STD_OUTPUT_HANDLE) ;
  11.     COORD pozicija;
  12.     pozicija.X=x; pozicija.Y=y;
  13.     SetConsoleCursorPosition(hStdout, pozicija) ; }
  14.  
  15.  
  16. int main()
  17. {
  18.   int stolp,vrst=0,i=1;
  19.  
  20.   srand(time(0));
  21.  
  22.   while (vrst < 25) {
  23.  
  24.      while(i <= 4) {
  25.  
  26.  
  27.      stolp=rand()%81;
  28.  
  29.      postavi_kurzor(stolp,vrst);
  30.  
  31.      cout << "A" << endl;
  32.  
  33.      i++;
  34.  
  35.  
  36.  
  37.      }
  38.  
  39.      vrst++;
  40.      i=1;
  41.  
  42.  
  43.   }
  44.  
  45.  
  46.  
  47.     return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement