冯晟轩题解

金字塔图案

http://www.nowcoder.com/questionTerminal/d84e8339f9444bb6b29bd3f227c8e538

include

using namespace std;
int main()
{
int n;
while(cin >> n){
for(int i = 0; i < n; i++){
for(int j = 1; j < n - i; j++)
cout << " ";
for(int j = 0; j <= i; j++)
cout << "* ";
cout << endl;
}
}
return 0;
}

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务