Составить программу на языке С++, позволяющую отредактировать заданный с консоли текстовый файл: заменить в нем на заглавные буквы все первые буквы в словах.Надо сделать так чтобы было (например "мама мыла раму", а станет "Мама Мыла Раму").Вот код.
| Код | //---------------------------------------------------------------------------
#pragma hdrstop
//--------------------------------------------------------------------------- #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<iostream> #include <locale> #include<cctype> #include<cstring> #include<string> #include<vcl.h> #pragma argsused int main(int argc, char* argv[]) { char help[100]; int n; setlocale(LC_ALL, "russian_russian"); FILE *f1, *f2; printf("Input file name\n"); gets(help); f1 = fopen(help, "rt"); if ((!f1)) { printf("File not found!"); } else { f2 = fopen("File2.txt", "wt"); { while (fgets(help,99,f1)) { help[n] = toupper(help[n]); fprintf(f2, "%s", help); } } getch(); return 0; } } //---------------------------------------------------------------------------
|
|