#include<iostream> #include<iomanip> using namespace std; int main(void){ int i,j; for(i=1;i<=9;i++){ for(int k=63-7*i;k>0;k--){ cout<<" "; } for(j=1;j<=i;j++){ cout<<setiosflags(ios_base::left)<<i<<"*"<<j<<"="<<setw(3)<<i*j<<setfill(' '); } cout<<endl; } return 0; }
输出结果: