*C++*
*
*
*Please ignore my previous reply and try this one...*
*
*
# include <iostream>
# include <string>
# include <vector>
# include <sstream>
using namespace std;
int main()
{
    string line = "this is a string", temp;
    istringstream liness( line );
    vector<string> splittedstrings;
    while (liness >> temp)
    {
       splittedstrings.push_back (temp);
    }
    for (int i=0; i < splittedstrings.size(); i++)
    {
        cout << splittedstrings[i] << endl;
    }
}

On Mon, Apr 18, 2011 at 12:37 PM, Sakthi Priyan <
[email protected]> wrote:

> *C++:*
>
> string line = "this is a string", temp;
>
> istringstream liness( line );
>
> getline( liness, temp, ' ' );
>
> vector<string> splittedstrings;
>
> while (temp != "")
> {
>
>    splittedstrings.push_back (temp);
>
>    getline( liness, temp, ' ' );
>
> }
>
>
>
> On Mon, Apr 18, 2011 at 12:22 PM, Vinay Julme <[email protected]>wrote:
>
>> Java:
>> String []str = "this is a string".split(" ");
>> for(int i = str.length-1; i >=0; i--)
>> System.out.println( str[ i ] );
>>
>>
>> 2011/4/18 João Víctor Rocon Maia <[email protected]>
>>
>>> Python:
>>> tokens = raw_input().split(' ')
>>> for i in tokens:
>>>    print i
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
>
> --
> - Thanks and Regards,
>
> *Sakthipriyan*
>



-- 
- Thanks and Regards,

*Sakthipriyan*

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to