国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

uva 839 (Not so mobile)天平 ---遞歸輸入

2019-11-06 06:14:06
字體:
來源:轉載
供稿:網友

java的寫法

import java.util.Scanner;public class Main {	static Scanner scan = new Scanner(System.in);	public static void main(String[] args) {		int T = scan.nextInt();		while(T--!=0){			if(solve(new M(0))){				System.out.PRintln("YES");			}else{				System.out.println("NO");			}			if(T!=0)System.out.println();		}	}	private static boolean solve(M w) {		M wl = new M(scan.nextInt());		M dl = new M(scan.nextInt());		M wr = new M(scan.nextInt());		M dr = new M(scan.nextInt());		boolean b1 = true,b2 = true;		if(wl.value==0)b1 = solve(wl);		if(wr.value==0)b2 = solve(wr);		w.value = wl.value+wr.value;		return b1&&b2&&wl.value*dl.value==wr.value*dr.value;	}		static class M{		public int value;		public M(int value){			this.value = value;		}	}}


上一篇:跟開濤學SpringMVC...

下一篇:導出excl

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 得荣县| 潜山县| 仙桃市| 巴彦淖尔市| 合作市| 霍州市| 无锡市| 米脂县| 台湾省| 安新县| 县级市| 上思县| 依兰县| 古蔺县| 华阴市| 丹巴县| 常德市| 娄底市| 嘉义县| 阿坝| 察隅县| 韩城市| 通榆县| 卓资县| 桃园市| 抚松县| 舟山市| 宜兰县| 边坝县| 阳西县| 太原市| 客服| 水富县| 汨罗市| 宣威市| 碌曲县| 海兴县| 竹溪县| 大埔县| 吉林市| 尉氏县|