Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <malloc.h>
- #include <string.h>
- int S(char *m)
- {
- int k = 0;
- while (*(m + k ++));
- // если вводить строку: abc
- // 1) 1 + 0 = 1 != 0;
- // 2) 2 + 1 = 3 != 0;
- // 3) 3 + 2 = 5 != 0;
- // 4) 0 + 3 = 3 != 0;
- return k;
- }
- int main()
- {
- char *n;
- n = (char *)malloc (200);
- scanf ("%s", n);
- printf ("%d", S(n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement