题解 | #牛牛的金币#

牛牛的金币

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

全部评论

相关推荐

10-30 19:23
已编辑
山东大学(威海) C++
牛至超人:其实简历是不需要事无巨细的写的,让对方知道你有这段经历就行了,最重要的是面试的时候讲细讲明白
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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