«
87~88、 3道 图形打印6(复杂字符图形)
点亮灯 发布于
阅读:73
C++

#include<iostream>
using namespace std;
int main() {
for (int i=1; i <= 5; i++) {
for (int j=1; j <= 6 - i; j++) {
cout << ' ';
}
for (int z=1; z <= i ;z++) {
cout << char(51 + i - 1);
}
cout << endl;
}
system("pause");//卡屏函数
return 0;
}

#include<iostream>
using namespace std;
int main() {
for (int i=1; i <= 5; i++) {
for (int j=1; j <= 9 - i; j++) {
cout << ' ';
}
for (int z=1; z <= i*2 -1;z++) {
cout << char(101 + i - 1);
}
cout << endl;
}
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 4 + i; j++) {
cout << ' ';
}
for (int z = 1; z <= 9-2*i; z++) {
cout << char(104 - i + 1);
}
cout << endl;
}
system("pause");//卡屏函数
return 0;
}

#include<iostream>
using namespace std;
int main() {
for (int i=1; i <= 5; i++) {
for (int j=1; j <= 6; j++) {
cout << ' ';
}
for (int z=1; z <= i;z++) {
cout << char(67 + i*3-3);
}
cout << endl;
}
system("pause");//卡屏函数
return 0;
}