C/C++ I/O (parsing)

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
minskcity
Experienced poster
Posts: 199
Joined: Tue May 14, 2002 10:23 am
Location: Vancouver

C/C++ I/O (parsing)

Post by minskcity »

Can anybody post here the easiest (the most simple, the fastest to code) way to read following form of input:

int1 (int2) int3

for example:

12 (-234) 456
or
-434 (5673) -82
UFP2161
A great helper
Posts: 277
Joined: Mon Jul 21, 2003 7:49 pm
Contact:

Post by UFP2161 »

[c]int a,b,c; scanf ("%d (%d) %d", &a, &b, &c);[/c]
Post Reply

Return to “C++”