Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Задача 2,11.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- char a;
- int N;
- setlocale(LC_ALL, "russian");
- cout << "Введите высоту: ";
- cin >> N;
- cout << "Введите знак: ";
- cin >> a;
- int k = N*2 - 1;
- for (int i = N - 1; i >= 0; i--){
- for (int j = 1; j <= k; j++){
- if ((j <= i) || (j > (k - i))){
- cout << " ";
- }
- else cout << a;
- }
- cout << endl;
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment