题解 | #牛牛的金币#

牛牛的金币

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");
        }
    }
}

全部评论

相关推荐

机械打工仔:有说的你怀疑一下就行了,直接问也太实诚了
点赞 评论 收藏
分享
05-22 09:23
门头沟学院 Java
点赞 评论 收藏
分享
码农索隆:单休一个月少休息4天,一年就是48天,平时节假日,别人3天假期,单休的两天
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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