题解 | #牛牛的金币#

牛牛的金币

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

//条件:坐标为整数,且保证 x1x+y1y=1  //即x y 只有一个不同,且相差为1
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        if(x < x1){
            System.out.print("r");
        }else if(x > x1){
            System.out.print("l");
        }else if(y < y1){
            System.out.print("u");
        }else{
            System.out.print("d");
        }
    }
}

全部评论

相关推荐

ohs的小木屋:比不少实习待遇高了
点赞 评论 收藏
分享
仁者伍敌:牛子这些人还会点一个自动回复,boss都不带回复的
点赞 评论 收藏
分享
投递长鑫存储等公司7个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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