-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.c
65 lines (47 loc) · 735 Bytes
/
test.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include<stdlib.h>
#include<stdio.h>
#define M
float a(int g){
int s;
for(; i < 23; ++i){
while(i > a){
i -= a;
a(2);
}
if(a-2 <= 3) break;
}
}
float x,y,z;
int main(){
int i = 2;
int a, b, d;
return 0;
}
int main2(){
int x;
scanf("%d",&x);
if(!((x>=1000&&x<=9999)||(x<=-1000&&x>=-9999))){
printf("-1");
exit(EXIT_FAILURE);
}
int y=x;
if(y<0)
y=-y;
int a=y/1000;
int b=(y/100)%10;
int c=(y/10)%10;
int d=y%10;
if(a%2==1)
a=a-1;
if(b%2==1)
b=b-1;
if(c%2==1)
c=c-1;
if(d%2==1)
d=d-1;
y=a*1000+b*100+c*10+d;
if(x<0)
y=-y;
printf("\n%d",y);
return 0;
}