Skip to content

Instantly share code, notes, and snippets.

Created October 12, 2017 04:33
Show Gist options
  • Save anonymous/ac76fac8c59ee201a6e2660ef36e41f7 to your computer and use it in GitHub Desktop.
Save anonymous/ac76fac8c59ee201a6e2660ef36e41f7 to your computer and use it in GitHub Desktop.
// 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