fork download
  1. //1. Дана строка из символов, найти кол-во слов начинающихся и кончающихся одной буквой
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. int main()
  6. {
  7. int c = 0, i = 0;
  8. char s[90], symb;
  9. gets_s(s);
  10. while (s[i] != '\0' && s[i] != '.')
  11. {
  12. symb = s[i];
  13. printf_s("%c", symb);
  14. while (s[i] != '\0' && (s[i] != ' ') && (s[i] != '.'))
  15. {
  16. i++;
  17. }
  18. if (s[i - 1] == symb)
  19. {
  20.  
  21. c++;
  22. }
  23. i++;
  24. }
  25. printf_s("%d", c);
  26. return 0;
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:2: warning: implicit declaration of function ‘gets_s’; did you mean ‘fgetpos’? [-Wimplicit-function-declaration]
  gets_s(s);
  ^~~~~~
  fgetpos
prog.c:13:3: warning: implicit declaration of function ‘printf_s’; did you mean ‘printf’? [-Wimplicit-function-declaration]
   printf_s("%c", symb);
   ^~~~~~~~
   printf
/usr/bin/ld: /home/H2RI7u/ccAiD11o.o: in function `main':
prog.c:(.text.startup+0x25): undefined reference to `gets_s'
/usr/bin/ld: prog.c:(.text.startup+0x5a): undefined reference to `printf_s'
/usr/bin/ld: prog.c:(.text.startup+0xca): undefined reference to `printf_s'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty