Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <fstream>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. char* s_insert(char* s, size_t m) {
  10.     size_t n = strlen(s) + 1;
  11.     char* t = s;
  12.     const char* k = "eyuioa";
  13.  
  14.     for (; *s; ++s) {
  15.         if (*s == 'a' || *s == 'e' || *s == 'y' || *s == 'u' || *s == 'i' || *s == 'o' || *s == 'A' || *s == 'E' || *s == 'Y' || *s == 'U' || *s == 'I' || *s == 'O') {
  16.             ++s;
  17.             if (!*s || (n >= m))
  18.             memmove(s + 1, s, (n - (size_t)(s - t)) * sizeof(char));
  19.             *s = ' *';
  20.         }
  21.     }
  22.     return t;
  23.     ofstream fout("‪C:\Users\Asus\Desktop\3_1C++.txt");
  24.     cout << " Новая строка : " << t;
  25.     fout.close();
  26. }
  27.  
  28. int main(void) {
  29.     char s[100];
  30.     ifstream fin("C:\Users\Asus\Desktop\fxujk.txt");
  31.     gets_s(s);
  32.     puts(s);
  33.     puts(s_insert(s, sizeof(s)));
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement