Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication3.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- char zn1 = '*';
- char zn2 = '<';
- char zn3 = '>';
- int n;
- cout << "n = ";
- cin >> n;
- if (n <= 0 || n%2==0) {
- cout << "niepoprawne dane" << endl;
- system("pause");
- return 0;
- }
- for (int i = 0;i < n;i++) {
- if (i != (n / 2) ){
- for (int j = 0;j < n-1;j++)
- cout << " ";
- cout << zn1;
- }
- else {
- for (int j = 0;j < (n / 2);j++)
- cout << zn2 << " ";
- cout << zn1<<" ";
- for (int j = 0;j < (n / 2);j++)
- cout << zn3 << " ";
- }
- cout << endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement