Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int n, m;
- cin >> n >> m;
- for(int i = 0; i < n; i++) {
- if (i == 0 || i < n / 2) {
- for(int j = 0; j < n; j++) {
- cout << ' ';
- }
- cout << endl;
- }
- else {
- for(int j = 0; j < n; j++) {
- if(j == i || j == n - i - 1)
- cout << '*';
- else cout << ' ';
- }
- cout << endl;
- }
- }
- for(int i = 0; i < n; i++) {
- if (i == 0 || i == n - 1) {
- for(int j = 0; j < n; j++) {
- cout << '*';
- }
- cout << endl;
- }
- else {
- cout << '*';
- for(int j = 0; j < n - 2; j++) {
- if(j == i - 1 || j == n - i - 2)
- cout << '*';
- else cout << ' ';
- }
- cout << '*' << endl;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement