C++学习(六):打印三角形

#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
    int line;
    cin >> line;
    string s;
    for (int i = 1; i <= line; ++i){
        s += "*";
        cout << s.c_str() << endl;
    }
    system("pause");
    return 0;
}
原文地址:https://www.cnblogs.com/liw66/p/11766181.html