赞
踩
Easy
`import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a=scanner.nextInt(); int b=scanner.nextInt(); int[] x=new int[a]; for (int i = 0; i <a ; i++) { x[i]=scanner.nextInt(); } for (int i = 0; i <b ; i++) { int f=scanner.nextInt(); int t=scanner.nextInt(); int temp=0; temp=x[f-1]; x[f-1]=x[t-1]; x[t-1]=temp; } System.out.println(); for (int i = 0; i <x.length ; i++) { System.out.println(x[i]); } } } `
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。