#include<iostream> using namespace std; int main() { int i,j,n=9; for(j=1;j<=n;++j) {for(i=1;i<=j;++i) cout<<i<<"×"<<j<<"="<<i*j<<" "; cout<<endl; } cout<<endl; return 0; }
运行结果:
#include<iostream> using namespace std; int main() { int i,j,n=9; for(j=1;j<=n;++j) {for(i=1;i<=j;++i) cout<<i<<"×"<<j<<"="<<i*j<<" "; cout<<endl; } cout<<endl; return 0; }
运行结果: