题解 | #空心三角形图案#
空心三角形图案
https://www.nowcoder.com/practice/2ccc5fca423e47f0b622fe6f151cfab4
#include <iostream> using namespace std; int main() { int n; while(cin>>n){ for(int i=1;i<=n;i++){ //行 for(int j=1;j<=i;j++){ //列 if(i==j||j==1||i==n){ cout<<"* "; } else{ cout<<" "; } } cout<<endl; } } return 0; } // 64 位输出请用 printf("%lld")