Created
October 12, 2017 04:33
-
-
Save anonymous/ac76fac8c59ee201a6e2660ef36e41f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ | |
#include <stdio.h> | |
#include <sstream> | |
using namespace std; | |
int main() | |
{ | |
stringstream seq; | |
int next; | |
seq.str("7 3 5 8 -1 0 6 7"); | |
while( ! seq.eof()) | |
{ | |
seq >> next; | |
if (seq.eof() && next == 7) | |
printf("%d ", next); | |
switch(next) | |
case 7: | |
case 8: | |
case -1: | |
case 0: | |
continue; | |
printf("%d ", next); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment