Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include "time.h"
  4. #include <cstdlib>
  5. #include <windows.h>
  6. #include <cmath>
  7.  
  8. using namespace std;
  9. using namespace std;
  10. int main()
  11. {
  12. int a,i,k,l;
  13. char b;
  14. cout << "Podaj dlugosc podstawy trojkata: ";
  15. cin >> a;
  16.  
  17.  
  18. if (a>1 && a>21 && a%2==0)
  19. {
  20. cout<<"podaj nieparzysta mniejsza od 21"<<endl;
  21. }
  22.  
  23.  
  24. cout << "Podaj znak: ";
  25. cin >> b;
  26. for (k=1; k<a+1; k=k+2)
  27. {
  28. for (l=1; l<a-k; l=l+2) // nowa pΔ™tla
  29. {
  30. cout << " ";
  31. }
  32. for (i=1; i<k+1; i++)
  33. {
  34. cout << b;
  35. }
  36. cout << endl;
  37. }
  38.  
  39.  
  40. cin.ignore();
  41. getchar ();
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement