您好,登錄后才能下訂單哦!
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"); } } }
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。