Advertisement
Guest User

Untitled

a guest
Oct 1st, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using std::cout;
  4. using std::endl;
  5.  
  6. int main(){
  7.     cout << "Donji trokut" << endl;
  8.     for(int i = 0; i < 5; i++){
  9.         for(int j = 0; j < 5; j++)
  10.             if( i < j)
  11.                 cout << "-";
  12.             else
  13.                 cout << "*";
  14.         cout << endl;
  15.     }
  16.  
  17.     cout << endl << "Gornji trokut" << endl;
  18.     for(int i = 0; i < 5; i++){
  19.         for(int j = 0; j < 5; j++)
  20.             if( i > j)
  21.                 cout << "-";
  22.             else
  23.                 cout << "*";
  24.         cout << endl;
  25.     }
  26.  
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement