九九乘法表

#include <iostream>

using namespace std;

int main()
{
    int j;
    int k;
    cout<<"打印九九乘法表"<<endl;
    for(j=1;j<=9;j++)
        for(k=1;k<=9;k++)
        if(k==9)cout<<"   "<<j*k<<endl;
        else
        cout<<"   "<<j*k;

}

另一种版本的九九乘法表

#include<iostream>
using namespace std;
int main()
{
    int j,k;
    for(j=1;j<=9;j++)
        {for(k=1;k<=j;k++)
            cout<<"j*k="<<j*k<<" ";
            cout<<endl;
    }
}

原文地址:https://www.cnblogs.com/ywj2013/p/3093806.html