Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void trojkat(int wys, int szer)
- {
- for(int i=0; i<wys; i++)
- {
- cout << "|";
- if(i<wys-1)
- for(int j=0; j<i; j++)
- {
- cout << " ";
- }
- if(i<wys-1)
- cout << "\\";
- if(i<wys-1)
- cout << endl;
- }
- for(int k=0; k<szer; k++)
- {
- cout << "_";
- }
- cout << "\\";
- }
- int main()
- {
- int szer, wys;
- cout << "wysokosc: ";
- cin >> wys;
- //cout << "szerokosc: ";
- //cin >> szer;
- szer = wys-1; // Inaczej trojkat sie rozjezdza i jest hoj :(
- trojkat(wys, szer);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement