Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int max(int x, int y) {
  4. if (x >= y) {
  5. return x;
  6. }
  7. else {
  8. return y;
  9. }
  10. }
  11.  
  12. int main(int argc, char** argv) {
  13. for (int i = 1; i < argc; ++i) {
  14. int j;
  15. int fst = 2;
  16. for (j = 2; argv[i][j] != '\0'; ++j) {
  17. if (fst == j && argv[i][j] == '0') {
  18. ++fst;
  19. }
  20. }
  21. int len = j - fst;
  22. printf("%d ", max((len + 1) / 2, 1));
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement