Skip to content

Commit f7f2087

Browse files
committed
Some basic ques'
1 parent a7a4cfd commit f7f2087

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

CodeForces/271A-Beautiful Year.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int x;
7+
cin >> x;
8+
for (int j = x + 1; j < 9020; j++)
9+
{
10+
set<int> st;
11+
int num = j;
12+
while (num != 0)
13+
{
14+
st.insert(num % 10);
15+
num = num / 10;
16+
}
17+
if (st.size() == 4)
18+
{
19+
cout << j;
20+
break;
21+
}
22+
}
23+
cout << "";
24+
return 0;
25+
}

CodeForces/443A-Anton and Letters.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
char x;
7+
set<char> st;
8+
while (cin >> x)
9+
{
10+
if (isalpha(x))
11+
st.insert(x);
12+
}
13+
cout << st.size();
14+
return 0;
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
string n1, n2;
7+
cin >> n1 >> n2;
8+
string ans = "";
9+
for (int i = 0; i < n1.size(); i++)
10+
{
11+
if (n1[i] == n2[i])
12+
{
13+
ans += "0";
14+
}
15+
else
16+
{
17+
ans += "1";
18+
}
19+
}
20+
cout << ans;
21+
return 0;
22+
}

0 commit comments

Comments
 (0)