智航學程式設計006(字串與時鐘 倒計時 紅綠燈)

2021-10-06 05:02:03 字數 1563 閱讀 5877

import time

s="春曉"

t1="春眠不覺曉"

print(s)

time.sleep(0.5)

print(t1)

time.sleep(1)

print("處處聞啼鳥")

time.sleep(1)

print("夜來風雨聲")

time.sleep(1)

print("花落知多少")

for i in range(10):

time.sleep(1)

import time

s="火箭發射-倒計時開始:"

print(s)

count = 10

for i in range(10):

print(count)

time.sleep(0.5)

count = count - 1

print("點火")

time.sleep(0.2)

print('進入平流層')

time.sleep(0.2)

print("""進入對流層

發射點發射任務

到達月球

""")

#字串使用三個雙引號,可以自定義格式

menu = """

******選單******

麻辣小龍蝦

麻辣鴨脖

****************

"""print(menu)

#turtle實現紅綠燈

字串 3 字串與函式

字串處理函式,及如何正確返回處理結果?char fun char str str abcde return str void main char str1 10 char str2 fun str1 cout 知識點 1 abcde 儲存在常量區 並非簡單區域性變數,區別於區域性變數陣列 所以可以返...

C語言程式設計(練習4 字串與字串函式)

題目 編寫乙個函式,其功能是使輸入字串反序。在乙個使用迴圈語句為這個函式提供輸入的完整程式中測試 實現 編寫乙個函式,其功能是使輸入字串反序。在乙個使用迴圈語句為這個函式提供輸入 的完整程式中測試 include include include define max 100 void reverse...

C語言程式設計(練習5 字串與字串函式)

題目 編寫乙個程式。功能是讀取輸入,直到遇到eof,並報告單詞數 大寫字母數 小寫字母數 標點符號數和數字字元數。使用ctype.h系列的函式 實現 編寫乙個程式。功能是讀取輸入,直到遇到eof,並報告單詞數 大寫字母數 小寫字母數 標點符號數和數字字元數。使用ctype.h系列的函式 includ...