赞
踩
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define endl '\n'
- int main()
- {
- for(int i=1;i<=9;i++)
- {
- for(int j=1;j<=i;j++)
- {
- cout<<i<<"*"<<j<<"="<<i*j<<" ";
- }
- cout<<endl;
- }
- return 0;
- }
- for i in range(1,10):
- for j in range(1,i+1):
- print(f'{i}*{j}={i*j}',end=' ')
- print()
- public class MultiplicationTable {
- public static void main(String[] args) {
- // 打印九九乘法表
- for (int i = 1; i <= 9; i++) {
- for (int j = 1; j <= i; j++) {
- // 输出乘法表达式和结果
- System.out.printf("%d*%d=%-3d ", j, i, i * j);
- }
- System.out.println(); // 换行
- }
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。