Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int main()
- {
- int n;
- cout <<"Liczba n:";
- cin >> n;
- for (int rows=0; rows!=n;rows++)
- {
- Sleep(200);
- for (int cols=0; cols!=n; cols++)
- {
- if (rows==0 || rows==n-1 || cols==0 || cols==n-1)
- {
- cout <<"*";
- }
- else
- {
- cout <<" ";
- }
- }
- cout << endl;
- }
- /* Rysowanie trójkąta:
- for (int i=0; i<n; i++)
- {
- //1. Puste pola
- for (int j=0; j<n-i; j++)
- {
- cout <<" ";
- }
- for (int k=0; k<2*i-1; k++)
- {
- cout <<"*";
- }
- cout << endl;
- }
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement