INPUt
format : string & integer * float (string)
For Example : I think & 10 *20.5(how are you)
OUTPUT
Format:
string
integer
floar
string
For Example
I think
10
20.5
how are you
Who has easier variant?
Moderator: Board moderators
I am not completely sure this will work, try it. Sorry for the dumb variable names.
Code: Select all
int main()
{
string test = "I think & 10*20.5(how are you)";
char a[30];
int b;
float c;
char d[30];
sscanf(test.c_str(), "%[A-Z,a-z, ] & %d * %f (%[A-Z,a-z, ])", a, &b, &c, d);
cout << a << endl;
cout << b << endl;
cout << c << endl;
cout << d << endl;
return 0;
}