python
#!/usr/bin/env python
# encoding=utf-8
# Date: 2016-08-25
# Author: Eric.zhangtj@homecredit.cn
# Purpose: Just for fun
TableLenth = int(raw_input("Input the Max lines you want:\n"))
for i in range(1, TableLenth+1):
for j in range(1, i+1):
result = i*j
print "%s * %s = %s\t" % (i,j,result),
print "\n"shell
#!/bin/bash # encoding=utf-8 # Date: 2016-08-25 # Author: Eric.zhangtj@homecredit.cn # Purpose: Just for fun read -p "Input the Max lines you want:" TableLenth for i in $(seq 1 $TableLenth) do for j in $(seq 1 $i) do result=$[$i * $j] echo -n -e "$i + $j = $result\t" done echo -e "\n" done
C
java
class MultiTable{
public static void main(String[] args){
int i,j;
for (i=1; i<=9; i++){
for (j=1; j<=i; j++){
System.out.print(i + "*" + j + "=" + i*j + "\t");
}
System.out.print("\n");
}
}
}免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。