#include <iostream> #include<cmath> #include<ctime> #include<string> #include <iomanip> #include <fstream> using namespace std; int main() { for (int i = 0; i < 8; i++) { for (int k = 0; k <= i; k++) { cout << " "; } for (int j = i; j < 8; j++) { cout <<" "<< static_cast<char>(j+97-i); } for (int j = 7; j >= i; j--) { cout << " " << static_cast<char>(j + 97 - i); } cout << "\n"; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter