-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path1120 - Contract Revision
70 lines (67 loc) · 1.3 KB
/
1120 - Contract Revision
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <stdio.h>
#include <string.h>
int main()
{
char n[1000],m[1000],p[1000];
int a,b,i,j=0,d,e,f,k;
while(1)
{
aa:
a=0;
b=0;
i=0;
j=0;
d=0;
e=0;
f=0;
scanf("%d",&d);
scanf("%s",&n);
if(d==0&&n[0]=='0'&&n[1]=='\0')
{
break;
}
b=strlen(n);
for(i=0; i<b; i++)
{
if(n[i]==(48+d)||n[i]=='0')
{
j++;
}
}
if(j==b)
{
printf("0\n");
}
else
{
for(i=0,j=0; i<b; i++)
{
if(n[i]==(48+d))
{
continue;
}
else
{
m[j]=n[i];
j++;
}
}
m[j]='\0';
for(i=0;i<j;i++){
if(m[i]=='0'){
continue;
}
else{
e=i;
for(k=e,f=0;k<j;k++,f++){
p[f]=m[k];
}
p[f]='\0';
printf("%s\n",p);
goto aa;
}
}
}
}
return 0;
}