package practices;
/**
- @Title: BalanceNum.java
- @Package: practices
- @Description:TODO
- @author: 陈帆
- @date: 2019年5月30日 下午10:32:28
- @version V1.0
*/
import java.util.Scanner;
public class BalanceNum {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String s = in.next();
char[] c = s.toCharArray();
if (c.length <= 1) {
System.out.println(“不是平衡数”);
} else {
Boolean f = false;
int z = 1;
int y = 1;
for (int i = 0; i < c.length; i++) {
z = (c[i] - ‘0’) * z;
for (int j = i + 1; j < c.length; j++) {
y = y * (c[j] - ‘0’);
}
if (z == y) {
f = true;
break;
} else {
y = 1;
}
}
if (f) {
System.out.println(“是平衡数”);
} else {
System.out.println(“不是平衡数”);
}
}
}
}