Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0x6E8FD4EC (ucrtbased.dll) в Lab 24.exe: 0xC0000005:
- нарушение прав доступа при записи по адресу 0x00500000.
- #include <string.h>
- #include <iostream>
- #include <Windows.h>
- #include <conio.h>
- #include <stdio.h>
- int main()
- {
- printf("Введите текст");
- char str[256], tmp;
- gets_s(str);
- int n = strlen(str), count;
- printf("Введите букву:");
- char t;
- scanf_s("%s", &t);
- for (int i = 0; i < n; i++)
- {
- if (str[i] == t)
- {
- if (str[i - 1] == 32 && i != 0 || i == 0)
- {
- count = 0;
- while (str[i] != 32 && i < n)
- {
- i++;
- count++;
- }
- if (str[i - 1] == ',')
- for (int j = i - count; str[j] != ','; j++)
- printf("%s", str[j]);
- printf(" ");
- }
- }
- }
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment