a090: 計算矩形面積
Tags :
Accepted rate : 223人/234人 ( 95% ) [非即時]
評分方式:
Strictly

最近更新 : 2022-08-15 05:07

Content

編寫一個Python程序,接受用戶輸入矩形邊長,並計算輸出矩形面積。

Input

一行輸入兩個正整數 a, b 作為矩形的長和寬,數值之間以一個空白鍵分隔

a, b < 100,000

Output

矩形面積

Sample Input #1
5 2
Sample Output #1
10
Sample Input #2
6 2
Sample Output #2
12
測資資訊:
記憶體限制: 64 MB
不公開 測資點#0 (33%): 1.0s , <1K
不公開 測資點#1 (33%): 1.0s , <1K
不公開 測資點#2 (34%): 1.0s , <1K
Hint :

In the online judge system, the inputs come from "standard input". To read the data from standard input, we can use a function called "input()".

>>in_line = input()

[Note 1]However, the input() function will only give you one single line of input (from standard input). To split the data from a single line, we need a function called "split()" to help.

>> inputs = in_line.split()
>> print(inputs[0], inputs[1])

[Note 2]Even we have successfully split the data, the data is still in "string" format. To do our math calculation, we need to convert the string into integer by a function called "int()".

>>a = int(inputs[0])
>> b = int(inputs[1])

Tags:
出處:
[管理者:
kichan@g.pui... (陳嘉賢CHAN KA IN)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」