Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How do I give int value to these line?

$
0
0
I just want a little advice on the following, I cant think of any way though I thought of another loop


I take input from a file, the file look like this:

1 - 4
Aqaba
1 - 2
Aqaba#Gulf of
1
Jordan
2
Kitchener, Field Marchal the Earl of
Damascas

Following is pseudo code:
while (line!=null)
{if(line contain [0-9])
 subsequents lines such as Damascas and Kitchener contain the int values.
}



I think I can do after the line contain number, the following lines will contain the integer values until another line contain numbers appear.

However, I have trouble transform this into code... can you guys help me out? I try if else and while loop inside the reading lines from file, but I think it probably wrong. Please tell me if I am not clear enough.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>