27 lines
398 B
C++
27 lines
398 B
C++
//正三角形
|
|
|
|
#include<iostream>
|
|
#include<windows.h>
|
|
|
|
using namespace std;
|
|
|
|
int main(){
|
|
int n;
|
|
cin >>n;
|
|
|
|
for (int i = 1; i <= n; i++)
|
|
{
|
|
for (int y = 1; y <= n-i; ++y)
|
|
{
|
|
cout <<" ";
|
|
}
|
|
|
|
for (int j = 1; j <= 2*i-1; ++j)
|
|
{
|
|
cout <<"*";
|
|
}
|
|
cout <<endl;
|
|
}
|
|
//Sleep(1000000000);
|
|
return 0;
|
|
} |