SHARE
TWEET

Untitled

a guest Feb 27th, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3.  
  4. public class Test
  5. {
  6.     public static void main(String[] args) {
  7.       Scanner sc = new Scanner(System.in);
  8.       int[] arr = new int[sc.nextInt()];
  9.       int b = 0;
  10.       while (b<arr.length) {
  11.         arr[b] = sc.nextInt();
  12.         b++;
  13.       }
  14.       b = arr.length - 1;
  15.       while (b>0) {
  16.         arr[b] = arr[b] - 1;
  17.         b--;
  18.         }
  19.       arr[0] = 0;
  20.         System.out.println(Arrays.toString(arr));
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top