标签:buffer div 不包含 amp 好的 bin i++ ++ nbsp
1 import java.io.BufferedReader; 2 import java.io.IOException; 3 import java.io.InputStreamReader; 4 5 public class Main { 6 public static void main(String[] args) throws IOException { 7 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 8 String[] str = br.readLine().split(" "); 9 int m = Integer.parseInt(str[0]); 10 int n = Integer.parseInt(str[1]); 11 int sum_m = f(m); 12 int sum_n = f(n); 13 14 if(sum_m == n && sum_n == m){ 15 System.out.println("yes"); 16 }else 17 System.out.println("no"); 18 19 } 20 21 private static int f(int x) { 22 int sum = 0; 23 for(int i = 1 ; i < x ; i++ ){ 24 if(x % i ==0){ 25 sum += i; 26 } 27 } 28 return sum; 29 } 30 31 }
标签:buffer div 不包含 amp 好的 bin i++ ++ nbsp
原文地址:http://www.cnblogs.com/cao-lei/p/6544637.html