-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5_2_9.c
51 lines (51 loc) · 1.05 KB
/
5_2_9.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
45
46
47
48
49
50
51
#include <stdio.h>
#include <stdlib.h>
void wytnij(char *napis, int n, int m)
{
int i, j;
for(i=0; napis[i]!=0; i++)
{
if (i+1>m)
{
for (j=0; j+m< i; j++)
{
napis[n+j]=napis[j+m+1];
}
}
else if ((n<i) && (i+1<=m))
{
napis[n]=0;
}
}
}
void wytnijwchart(wchar_t *napis, int n, int m)
{
int i, j;
for(i=0; napis[i]!=0; i++)
{
if (i+1>m)
{
for (j=0; j+m< i; j++)
{
napis[n+j]=napis[j+m+1];
}
}
else if ((n<i) && (i+1<=m))
{
napis[n]=0;
}
}
}
int main()
{
char napis[] = "MAMMAmiaHEREiGOagain";
wchar_t napiswchart[] = L"MAMMAmiaHEREiGOagain";
printf("%s\n", napis);
wytnij(napis, 8, 20);
printf("%s\n", napis);
printf("\n");
wprintf(L"%s\n", napiswchart);
wytnijwchart(napiswchart, 8, 20);
wprintf(L"%s\n", napiswchart);
return 0;
}