Skip to content

Commit 077541f

Browse files
committed
Update problem17.cpp
1 parent e19810d commit 077541f

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

problem17.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,41 @@ int main()
2323
cout << (xor1 ^ xor2);
2424
return 0;
2525
}
26+
27+
//SOlved by Vignesh CS, CSE
28+
29+
#include<conio.h>
30+
31+
#include<iostream.h>
32+
33+
int main()
34+
35+
{
36+
37+
int a=0,b=0,i,n,c[10];
38+
39+
Cin>>n;
40+
41+
For(i=o;i<n;i++)
42+
43+
{cin>>c[i];
44+
45+
}
46+
47+
For(i=0;i<n;i++)
48+
49+
{
50+
51+
a ^=i;
52+
53+
b ^=c[i];
54+
55+
}
56+
57+
a ^=n;
58+
59+
char d=a ^ b;
60+
61+
cout<<d;
62+
63+
}

0 commit comments

Comments
 (0)