include stdio include conio char res 150 void insert char str int char

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <conio.h>
char res[150];
void insert(char str[]) {
int i, n;
char last;
for (i=0; str[i]!=0;i++) last=str[i];
for (i=0; str[i]!=0; i++) {
if (str[i] >= '0' && str[i] <= '9') {
n = i;
break;
}
}
for (i=0; i<=n; i++) res[i]=str[i];
res[n+1] = last;
for (i=n+1; str[i]!=0; i++) res[i+1] = str[i];
}
void main() {
char str[149];
printf("vvedite stroku: ");
gets(str);
insert(str);
printf("result: %s\n", res);
getch();
}