daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /******************************************************************************
  2.  
  3.                               Online C++ Compiler.
  4.                Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10. #include <math.h>
  11. #include <conio.h>
  12. using namespace std;
  13.  
  14. int linie;
  15. void rysowanie1(int linie);
  16. void rysowanie2(int linie);
  17. int main()
  18. {
  19.     cout << "Podaj ilość linii do narysowania: ";
  20.     cin >> linie;
  21.    
  22.     rysowanie1(linie);
  23.     rysowanie2(linie);
  24.     return 0;
  25. }
  26.  
  27. void rysowanie1(int linie)
  28. {
  29.    
  30.     for (int i=1;i<=linie;i++)
  31.     {
  32.         for(int j=1;j<=i;j++)
  33.         {
  34.            cout << "*";
  35.         }
  36.         cout << "\n";
  37.     }
  38. }
  39. void rysowanie2(int linie)
  40. {
  41.    
  42.     for (int i=linie;i>=1;i--)
  43.     {
  44.         for(int j=1;j<=i;j++)
  45.         {
  46.            cout << "#";
  47.         }
  48.         cout << "\n";
  49.     }
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top