Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <string>
- using namespace std;
- int n,k;
- string s[10005];
- int main(){
- cin>>n>>k;
- for(int i = 1; i <= n; i++)
- {
- s[i] = to_string(i);
- }
- sort(s+1,s+n+1);
- string t = to_string(k);
- for(int i = 1; i <= n; i++)
- {
- if(s[i]==t)
- {
- cout<<i;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement