Skip to content

Instantly share code, notes, and snippets.

@prydin
Last active May 2, 2019 11:58
Show Gist options
  • Save prydin/7c91c8464889086fbec1db67ad79243b to your computer and use it in GitHub Desktop.
Save prydin/7c91c8464889086fbec1db67ad79243b to your computer and use it in GitHub Desktop.
int last = input();
for(;;) {
int now = input();
if(last == 0 && now == 1) {
printf("Positive flank detected. Bailing!");
break;
}
last = now;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment