//第一题 public static void main(String[] args) { Scanner sc = new Scanner(System.in); int len = sc.nextInt(); String str = sc.next(); sc.close(); if (len < 2){ System.out.println(0); } int left = 0; int right = len - 1; int res = 0; while (left < right){ if (str.charAt(left) != str.charAt(right)){ res++; } left++; right--; } System.out.println(res); }

相关推荐

牛客网
牛客企业服务