Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
strend
A_141117_Primo01
bit wise operation
A_141211_Tartaglia
2.1.1 Prime numbers in different threads with thread ID
str_ptr_to_fumc_v2
Student. Txt
than mine time's ocean as real white shakedown marine is mistake
Good
Test 4
Please log in to post a comment.