Is there a way in C to in one line I input a word, than how many times a word appears in text, and all positions?
For example:
egg(word), 4(number of positions, how many time appears), 2 8 9 4(all positions in text or array)
In same line input string,number of positions and positions?
Started by carbon, Jan 22 2012 04:39 AM
5 replies to this topic
#1
Posted 22 January 2012 - 04:39 AM
|
|
|
#2
Posted 22 January 2012 - 04:58 AM
Quote
Is there a way in C to in one line I input a word,..
#3
Posted 22 January 2012 - 05:02 AM
a way to input a word in one line...
#5
Posted 22 January 2012 - 05:31 AM
Flying Dutchman said:
User has to input word, number of positions and positions... i know that a word goes first, then a number of position, but i dont know how many positions will be there if you know what i mean.... If user input 7 (number of posizion), i must have 7 positions for him to input those positions...
eg.
word, 5, (here must enter 5 positions)
awesome, 3, (here must enter 3 positions)
#6
Posted 22 January 2012 - 05:47 AM
Then it's best to read entire line as string and then parse the numbers.
A conclusion is where you got tired of thinking.
#define class struct // All is public.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









