4.25美团笔试,第二题一直是18,有大佬帮忙看一下为什么吗
4.25美团笔试,第二题一直是18,有大佬帮忙看一下为什么吗
public class Main { public static void main(String[] args){ String str; int q; Scanner sc = new Scanner(System.in); str = sc.nextLine(); char[] ch = str.toCharArray(); q = sc.nextInt(); for (int i = 0; i < q; i++){ int l = sc.nextInt(); int r = sc.nextInt(); int k = sc.nextInt(); for (int j = l-1; j < r; j++){ int a = ch[j]-k; if (a < 97){ a += 26; } ch[j] = (char)a; } } String s = String.valueOf(ch); System.out.println(s); } }#美团#