Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
finding 3 ones in a row
//gcc 5.4.0 #include <stdio.h> int main(void) { int temp = 0; int counter = 0; unsigned int x = 1011101101; while (x != 0) { temp = x % 10; x /= 10; if (temp == 1 && counter != 3) { counter++; } else if (temp == 0) { counter = 0; } if (counter == 3) { printf("returning 1"); return 1; } } printf("returning 0"); return 0; }
run
|
edit
|
history
|
help
0
fibonacci
SEGUNDO AVANCE DE NETFLIX
A_141124Burbuja
Spring 2017 Project 2 v1.3
A_141212_IntercambiarValores
C_141113_dividirRestasSucesivas
Undefined behavior
B_141107_Factorial
problemapi3
PointTeleBook