- 论坛徽章:
- 2
|
本帖最后由 yinyuemi 于 2013-05-29 17:08 编辑
回复 1# UltimateSniper - awk 'BEGIN{for(i=1;i<=9;i++){print (t=t i),"*",8,"+",i," = ",t*8+i}}'
- 1 * 8 + 1 = 9
- 12 * 8 + 2 = 98
- 123 * 8 + 3 = 987
- 1234 * 8 + 4 = 9876
- 12345 * 8 + 5 = 98765
- 123456 * 8 + 6 = 987654
- 1234567 * 8 + 7 = 9876543
- 12345678 * 8 + 8 = 98765432
- 123456789 * 8 + 9 = 987654321
- awk 'BEGIN{for(i=1;i<=8;i++){print (t=t i),"*",9,"+",i+1," = ",t*9+(i+1)}}'
- 1 * 9 + 2 = 11
- 12 * 9 + 3 = 111
- 123 * 9 + 4 = 1111
- 1234 * 9 + 5 = 11111
- 12345 * 9 + 6 = 111111
- 123456 * 9 + 7 = 1111111
- 1234567 * 9 + 8 = 11111111
- 12345678 * 9 + 9 = 111111111
- awk 'BEGIN{for(i=9;i>1;i--){print (t=t i),"*",9,"+",i-2," = ",t*9+(i-2)}}'
- 9 * 9 + 7 = 88
- 98 * 9 + 6 = 888
- 987 * 9 + 5 = 8888
- 9876 * 9 + 4 = 88888
- 98765 * 9 + 3 = 888888
- 987654 * 9 + 2 = 8888888
- 9876543 * 9 + 1 = 88888888
- 98765432 * 9 + 0 = 888888888
- [jhou@localhost Dataset Published]$ awk 'BEGIN{for(i=9;i>1;i--){print (t=t 1),"*",(t)," = ",t*t}}'
- 1 * 1 = 1
- 11 * 11 = 121
- 111 * 111 = 12321
- 1111 * 1111 = 1234321
- 11111 * 11111 = 123454321
- 111111 * 111111 = 12345654321
- 1111111 * 1111111 = 1234567654321
- 11111111 * 11111111 = 123456787654321
复制代码 |
|