import java.io.*; /** * 善用 System.arraycopy() */ public class Main { public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); public static StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); public static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws Exception { cin.nextToken(); int n = (int) cin.nval; int[] num = new int[n]; for (int i = 0; i < n; i++) { cin.nextToken(); num[i] = (int) cin.nval; } cin.nextToken(); int m = (int) cin.nval; int[] newNum = new int[n]; System.arraycopy(num, n - m, newNum, 0, m); System.arraycopy(num, 0, newNum, m, n - m); for (int i : newNum) { cout.printf("%d ", i); } cout.flush(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:981 |
C语言训练-数字母 (C语言代码)浏览:670 |
【金明的预算方案】 (C++代码)浏览:873 |
矩阵加法 (C语言代码)浏览:1768 |
Tom数 (C语言代码)浏览:598 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:692 |
C语言训练-字符串正反连接 (C语言代码)浏览:653 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:469 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:507 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:456 |