---
# System prepended metadata

title: '20190924'

---

# 20190924

寫下如何完成 Big File 這題 CTF
-抓下網路原始檔curl並下載

簡述 mv ./a ./b 這行指令意義
-將檔案a改名為檔案b

使用 Python 印出菱形並截圖4顆*、5顆*、6顆*輸出結果
```
a=int(input())
b=a-1
e=a+b
c=1
d=1
while(True):
    for i in range(0,b):
        print " ",
    for i in range(0,c):
        print "*",
    print("\n")
    if d==0 and c==1:
        break
    if c==e:
        d=0;
    if d==1:
        b-=1
        c+=2
    if d==0:
        b+=1
        c-=2

```
- ![](https://i.imgur.com/DnJckbu.jpg)
- ![](https://i.imgur.com/1gJoa22.jpg)



使用 Python 印出並截圖4顆*、5顆*、6顆*輸出結果
```
a=int(input())
b=1
c=1
d=a+b
e=a
while(True):
    if c==1:
        for i in range(0,a):
            print "*",
    if c==0 or c==2:
        for i in range(0,b):
            print " ",
        for i in range(0,a):
            print"*",
    print("\n")
    if c==2:
        c=0
    if a==1 and c==1:
        c=2
        b=b*2+1
    if c==0 and a==e:
        break
    if c==1:
        a-=1
        b+=1

    if c==0:
        a+=1
        b-=1

```
-![](https://i.imgur.com/1DJmEcS.jpg)
-![](https://i.imgur.com/9tI2L7E.jpg)


寫一個 Python Function

輸入 200 輸出 2*100
輸入 123 輸出 1*100+2*10+3*1
請附程式碼，並給10個輸入，並截圖輸出結果
```
for i in range(0,10):
    a=int(input())
    b=a%10
    c=a%100//10
    d=a//100
    if(d!=0):
        print d,"*100",
    if(d!=0 and c!=0):
        print "+",
        print c,"*10",
    elif(d==0 and c!=0):
        print c,"*10",
    if(d!=0 and b!=0):
        print "+",
        print b,"*1",
    elif(d==0 and c!=0 and b!=0):
        print "+",
        print b,"*1",
    elif(b!=0):
        print b,"*1",
    print "\n"

```
![](https://i.imgur.com/B9gAIj1.jpg)


