hdu1721

将E、H、G、F点上的粒子数转移到F点,等于F-G-E+H;

将A、B、C、D点上的粒子数转移到B点,等于B-C-A+D,判断这两是否相等就好。

import java.util.Scanner;

public class hud1721 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int a = sc.nextInt();
            if (a==-1){
                break;
            }
            int b = sc.nextInt();
            int c = sc.nextInt();
            int d = sc.nextInt();
            int e = sc.nextInt();
            int f = sc.nextInt();
            int g = sc.nextInt();
            int h = sc.nextInt();
            if ((f-g-e+h)==(b-c-a+d)){
                System.out.println("All the seeds can be cleared away!");
            }else{
                System.out.println("Sorry,it can't be cleared away!");
            }
        }
    }
}

 

posted @ 2025-02-20 13:41  XiaohuangTX  阅读(4)  评论(0)    收藏  举报