- sentence=input("文字を入力する:")
- #画面の幅、長さ、横幅
- screen_width=80
- text_width=len(sentence)
- box_width=text_width+6
- left_marjin=(screen_width-box_width)//2
- print()
- print(''*left_marjin+'+' +'-'*(box_width-2)+ '+')
- print(''*left_marjin+'| ' +' '*text_width +' |')
- print(''*left_marjin+'| ' + sentence +' |')
- print(''*left_marjin+'| ' +' '*text_width +' |')
- print(''*left_marjin+'+' +'-'*(box_width-2)+ '+')
- print()