HDOJ 1898 Sempr == The Best Problem Solver?

来源:互联网 发布:mac顶部工具栏 编辑:程序博客网 时间:2024/05/21 19:25

HDACM 1898

翻译题,求谁的余数小就OK

import java.util.Scanner;public class Main{    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        int n = sc.nextInt();        while(n-->0){            int a = sc.nextInt();            int b = sc.nextInt();            int t = sc.nextInt();            a = t%a;            b = t%b;            if (a>b) {                System.out.println("Xiangsanzi!");            }else if (a==b) {                System.out.println("Both!");            }else{                System.out.println("Sempr!");            }        }        sc.close();    }}