Compare commits
No commits in common. "77d3aafd48bd50a3456d9a68422f3e8dd51afb2f" and "7f287d3e5621e85c3181cfab5ca7a0430089e60e" have entirely different histories.
77d3aafd48
...
7f287d3e56
@ -1,23 +1 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int strlen(char s[]) {
|
||||
int len = 0; // счетчик
|
||||
|
||||
// Перебираем символы строки
|
||||
while (s[len] != '\0') {
|
||||
len++;
|
||||
}
|
||||
|
||||
return len; // Возвращаем длину
|
||||
}
|
||||
|
||||
int main() {
|
||||
char str1[] = "Hello, world!";
|
||||
char str2[] = "C programming";
|
||||
|
||||
printf("Длина строки \"%s\" = %d\n", str1, strlen(str1));
|
||||
printf("Длина строки \"%s\" = %d\n", str2, strlen(str2));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user