Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- // необходимо вывести наиболешее из двух чисел
- setlocale(LC_ALL, "ru");
- int a;
- cout << "Введите размер фигуры (нечетное число): ";
- cin >> a;
- for (int i = 0; i < a; i++) {
- for (int j = 0; j < a; j++) {
- if (j >= i) {
- cout << " * ";
- }
- else {
- cout << " ";
- }
- }
- cout << endl;
- }
- cout << endl;
- for (int i = 0; i < a; i++) {
- for (int j = 0; j < a; j++) {
- if (j < a - i) {
- cout << " * ";
- }
- else {
- cout << " ";
- }
- }
- cout << endl;
- }
- cout << endl;
- for (int i = 0; i < a; i++) {
- for (int j = 0; j < a; j++) {
- if (j >= i && j < a - i) {
- cout << " * ";
- }
- else {
- cout << " ";
- }
- }
- cout << endl;
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment