d018. 字串讀取練習
Tags : stringstream 字串
Accepted rate : 2374人/2839人 ( 84% ) [非即時]
評分方式:
Tolerant

最近更新 : 2010-10-05 18:18

Content

練習字串的分析與處理

 

Input

一個字串,內部包含數組資料,每組資料有一個序號,及一個實數。

格式如下: 序號:實數 

請注意,序號有可能跳號 

Output

請求出所有序號為奇數的實數的和減掉所有序號為偶數的實數,並印出結果。 

 

Sample Input #1
1:12.5 2:12 3:13.1 4:13.0
1:1.2 3:2.3
Sample Output #1
0.6
3.5
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (100%): 1.0s , <1M
Hint :
* C++ 可利用 stringstream 來分析字串
Tags:
stringstream 字串
出處:

Status Forum 排行

ID User Problem Subject Hit Post Date
38511 batido (張凱強的大弟子) d018
Java解題技巧
390 2023-12-01 22:27
31545 krameri120 (科科) d018
c語言解題
776 2022-08-06 20:47
29849 alex950301 (alex0301) d018
1077 2022-04-05 14:44
29367 yp11051026@y ... (911-24吳秉儒) d018
837 2022-02-18 22:59
26824 406490150@gm ... (我是朱朱) d018
1259 2021-08-26 16:41