#14261: 要怎麼多筆輸入?


qqqq123 (unknown)

School : 國立嘉義高級中學
ID : 79351
IP address : [180.217.79.57]
Last Login :
2019-06-29 13:46:04
c640. 滿滿的糖果屋 #1 -- it's david | From: [110.50.190.181] | Post Date : 2018-07-07 19:05

本題沒有給輸入n行,用while()會一直讀入,要怎麼判斷下一筆測資?

 
#14262: Re:要怎麼多筆輸入?


asnewchien@gmail.com (david)

School : Not Student
ID : 68108
IP address : [1.168.25.250]
Last Login :
2019-07-20 19:18:04
c640. 滿滿的糖果屋 #1 -- it's david | From: [61.223.47.61] | Post Date : 2018-07-07 21:29

本題沒有給輸入n行,用while()會一直讀入,要怎麼判斷下一筆測資?




getline stringstream cpp

 
#14264: Re:要怎麼多筆輸入?


henry81003003 (Obelisk)

School : 輔仁大學
ID : 62554
IP address : [180.177.24.108]
Last Login :
2019-03-07 22:12:04
c640. 滿滿的糖果屋 #1 -- it's david | From: [180.177.24.47] | Post Date : 2018-07-08 00:34

本題沒有給輸入n行,用while()會一直讀入,要怎麼判斷下一筆測資?




getline stringstream cpp




只要設定if(n==0&&m==0) break 的條件就可以了

 
ZeroJudge Forum