Skip to content

Instantly share code, notes, and snippets.

@aperture147
Last active December 18, 2017 10:36
Show Gist options
  • Save aperture147/6f688b054145180bf56c3cab03454aae to your computer and use it in GitHub Desktop.
Save aperture147/6f688b054145180bf56c3cab03454aae to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class MainApp {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Nhap do dai mang: ");
int n = input.nextInt();
int[] array = new int[n];
for (int i = 0; i < n; i++) {
System.out.printf("array[%d]=", i);
array[i] = input.nextInt();
}
System.out.println("Mang da nhap la: ");
for (int i = 0; i < n; i++) {
System.out.print(array[i] + " ");
}
System.out.println();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment