-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbcrwd1071.c
More file actions
58 lines (45 loc) · 904 Bytes
/
bcrwd1071.c
File metadata and controls
58 lines (45 loc) · 904 Bytes
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
#include<stdio.h>
int main()
{
int x,y,i,sum=0,min,max;
scanf("%d%d",&x,&y);
if(x>y){
min=y;
max=x;
}
else {
min=x;
max=y;
}
for(i=(min+1);i<max;i++){
if(i%2!=0){
sum=sum+i;
}
}
printf("%d\n",sum);
return 0;
}
// 1071 solve in function
// #include<stdio.h>
// int sumco(int x,int y,int max,int min,int sum){
// if(x>y){
// max = x;
// min = y;
// }
// else{
// max = y;
// min = x;
// }
// for (int i = (min+1); i < max;i++){
// if(i%2!=0){
// sum = sum + i;
// }
// }
// return sum;
// }
// int main(){
// int x, y,max,min,sum=0;
// scanf("%d %d", &x, &y);
// printf("%d\n", sumco(x, y,max,min,sum));
// return 0;
// }