#include <iostream> using namespace std; int main(int argc, char **argv) { cout << "嗨客网(www.haicoder.net)\n" << endl; //打印每一行 int y = 1; for (y = 1; y <= 9; y++) { int x = 1; // 打印每一行里面的每一列 for (x = 1; x <= y; x++) { cout << x << " * " << y << " = " << x*y << " "; } //每一行之后的换行 cout << endl; } return 0; }
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