package AdvancedLevelPractice;
import java.math.BigDecimal;
import java.util.Scanner;
public class pat1023 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String valueString = scanner.next();
int length = valueString.length();
int N = 10, flag = -1;
int[] digit = new int[N];
for(int i = 0; i < length; i++){
digit[valueString.charAt(i) - '0']++;
}
BigDecimal valueBigDecimal = new BigDecimal(valueString);
BigDecimal resultBigDecimal = valueBigDecimal.multiply(new BigDecimal(2));
String resultString = resultBigDecimal.toString();
int length2 = resultString.length();
if(length != length2){
flag = -1;
}
else {
int i,j;
for(i = 0; i < length2; i++){
int c = resultString.charAt(i) - '0';
digit[c]--;
if(digit[c] < 0){
flag = -1;
break;
}
}
if(i == length2){
flag = 1;
}
}
if(-1 == flag){
System.out.println("No");
}
else {
System.out.println("Yes");
}
System.out.println(resultString);
scanner.close();
return ;
}
}
pat1023
最新推荐文章于 2020-11-26 19:37:21 发布