[quote="noix"]
#include <iostream>
int main(void) {
char c, d=10;
while(std::cin.get(c) && (c!='2' || d!='4') && std::cout.put(d))
d=c;
}
[/quote]
This TEST solution is wrong, isn'it?
In case of input 8, 99, 4, 2, 10, 42, 3 it will output 8, 99.
I see that it's enough that it works for the test case, but as example answer it is not the best...