题解 | #牛牛的金币#

牛牛的金币

http://www.nowcoder.com/practice/35d8e3e569dc49f2a1018d1dc9186998

import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        int x1 = scanner.nextInt();
        int y1 = scanner.nextInt();
        if(y + 1 == y1 && x == x1){
            System.out.print('u');
        }else if(y - 1 == y1 && x == x1){
            System.out.print('d');
        }else if(x + 1 == x1 && y == y1){
            System.out.print('r');
        }else if(x - 1 == x1 && y == y1){
            System.out.print('l');
        }
    }
}

全部评论

相关推荐

10-11 14:44
济南大学 Java
点赞 评论 收藏
分享
点赞 评论 收藏
分享
迷茫的大四🐶:那你问他上班之后老实了没
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
正在热议
更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务