Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <Windows.h>
- #include <ctype.h>
- #include <string.h>
- #include <locale.h>
- #define N 256
- int main()
- {
- setlocale(LC_ALL, "rus");
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- int n = 0;
- char g;
- int caps = 0, white = 0;
- char str[n][10*N];
- while ((g = getc(stdin) != EOF) && g !='n') {
- fgets(str[n], 10*N, stdin);
- for (int k = 0; k < strlen(str[n]) - 2; k++) {
- if ((str[n][k] != '.' || str[n][k] != '!' || str[n][k] != '?') && str[n][k + 1] == ' ' && isalpha(str[n][k + 2]) && isupper(str[n][k + 2])) {
- str[n][k + 2] = tolower(str[n][k + 2]);
- caps++;
- }
- if (str[n][k] == ' ') white++;
- }
- n++;
- }
- printf("n");
- if (caps == white) {
- printf("В тексте начинаются с большой буквы все фразы.");
- } else printf("В тексте начинаются с большой буквы не все фразы!");
- printf("nn");
- for (int i = 0; i < n; i++) puts(str[i]);
- return 0;
- }
Add Comment
Please, Sign In to add comment