Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include "time.h"
- #include <cstdlib>
- #include <windows.h>
- #include <cmath>
- using namespace std;
- using namespace std;
- int main()
- {
- int a,i,k,l;
- char b;
- do{
- cout << "Podaj dlugosc podstawy trojkata: ";
- cin >> a;
- }
- while (a<1 || a>21 || a%2==0);
- cout<<"dobrze"<<endl;
- cout << "Podaj znak: ";
- cin >> b;
- for (k=1; k<a+1; k=k+2)
- {
- for (l=1; l<a-k; l=l+2)
- {
- cout << " ";
- }
- for (i=1; i<k+1; i++)
- {
- cout << b;
- }
- cout << endl;
- }
- cin.ignore();
- getchar ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement