import java.util.Scanner;
class Solution{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s1 = sc.nextLine();
String str = sc.nextLine();
char[] nums = s1.toCharArray();
int x = nums[0] - '0';
int y = nums[2] - '0';
char[] arr = str.toCharArray();
for(int i = 0; i < arr.length; ++i){
switch(arr[i]){
case 'U': ++y; break;
case 'D': --y; break;
case 'R': ++x; break;
case 'L': --x; break;
}
}
System.out.print(x +" "+ y);
}
}
全部评论
(0) 回帖