1 #include<iostream> 2 #include<cmath> 3 using namespace std; 4 5 int main() 6 { 7 int n; 8 //cin>>n; 9 n = 15; 10 char chars[n][n*2-1]; 11 for(int i=0;i<n;++i){ 12 for(int j = 0;j<2*i+1;++j){ 13 chars[i][j] = char(65+abs(i-j)); 14 } 15 } 16 for(int i=0;i<n;++i){ 17 for(int j = 0;j<2*i+1;++j){ 18 cout<<chars[i][j]; 19 } 20 cout<<endl; 21 } 22 return 0; 23 }
A1032. 画三角形2 C++
猜你喜欢
转载自www.cnblogs.com/wx-tech/p/10460155.html
今日推荐
周排行