#include <stdio.h> #include<iostream> #include <iomanip> using namespace std; int main(){ int data[9][9]; int i=0; int j=0; for(i=0;i<9;i++){ for (j=0;j<9;j++){ data[i][j]=1; } } for(i=1;i<9;i++){ for (j=1;j<i;j++){ data[i][j]=data[i-1][j]+data[i-1][j-1]; } } for (i=0;i<9;i++){ for(int k=0;k<26-(6*i/2);k++){ cout<<" "; } for (j=0;j<=i;j++){ cout<<setw(6)<<data[i][j]; } cout<<endl; } return 0; }
标签:std,main,数字,int,三角形,include From: https://www.cnblogs.com/w6826301/p/17588680.html