Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main() {
- int n, i = 1, s = 0; //i - счетчик строк, номер строки
- cin >> n; // n - высота пирамиды
- while (i <= n) {
- s = 0; // s - счетчик выведенных звездочек на данной строке
- while (s < i) {
- cout << "*";
- ++s;
- }
- cout << endl;
- ++i;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement