#include<iostream>
using namespace std;
#define N 5
void main() { int i,j,k;
for ( i=0,k=0;i<N;i++ ) {
for ( j=0;j<i*2+1;j++,k++ ) cout<<(char)('A'+k);
cout<<endl;
}
}
用C++如何编写一个直角三角形图案:A BCD EFGHI JKLMNOP QRSTUVWXY
using namespace std;define N 5 void main() { int i,j,k;for ( i=0,k=0;i<N;i++ ) { for ( j=0;j<i*2+1;j++,k++ ) cout<<(char)('A'+k);cout<<endl;} }
编程输出如下图形 A BCD
(j>=line-1-i)?printf("%c",origin++):printf(" ");printf("\\n");} }
...A BCD EFGHI JKLMNOP QRSTUVWXY ZABCDEF GHIJK LMN O
char ch = 'A';if (n != 0){ \/\/打上面的三角形 for (int i = 0; i < n + 1; i++){ for (int j = 0; j < n - i; j++){ Console.Write(' ');} for (int j = 0; j < 2 * i + 1; j++){ Console.Write(ch);ch++;if (ch > 'Z'){ ch = 'A';} ...
输出字母三角形
include <stdio.h> void main(){ char start;int h;int iLoop,jLoop;printf("请输入首字母: \\t");scanf("%c",&start);printf("\\n请输入高度: \\t");scanf("%d",&h);for(iLoop=0; iLoop<h; iLoop++){ for(jLoop=0; jLoop<2*iLoop+1; jLoop++){ printf("%c",start++);}...