题目链接:https://codeforces.com/contest/12/problem/B
给出1个数字重新组合使字典序最小且不允许有前导零。
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
char a[20],b[20];
int main()
{
scanf("%s%s",a,b);
int len=strlen(a);
sort(a,a+len);
int pos=0;
while(a[pos]=='0') pos++;
if(pos<len) swap(a[pos],a[0]);
puts(strcmp(a,b)==0?"OK":"WRONG_ANSWER");
return 0;
}