-
Notifications
You must be signed in to change notification settings - Fork 0
/
rep.c
44 lines (41 loc) · 754 Bytes
/
rep.c
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
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void replace(){
char replace[50][50];
FILE *ou = fopen("ram07.txt", "r");
int kk = 0;
int zeo = 0;
while (1)
{
kk = fscanf(ou,"%s", replace[zeo]);
zeo++;
if (kk == EOF)
{
break;
}
}
fclose(ou);
char id[40];
fflush(stdin);
FILE*mou=fopen("ram07.txt","w");
int ln;
printf("Enter ln:");
scanf("%d",&ln);
int k=0;
while(1){
if(k+1==ln){
strcpy(replace[k],"numnumnumnum");
}
fprintf(mou,"%s\n",replace[k]);
if(k==zeo){
break;
}
k++;
}
fclose(mou);
}
int main() {
replace();
return 0;
}