Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package loiane;
- import java.util.Scanner;
- public class blz {
- public static void main(String[] args) {
- int[] vA = new int[5];
- int[] vB = new int[vA.length];
- Scanner sc = new Scanner(System.in);
- for(int i = 0;i<vA.length;i++){
- System.out.println("Digite o valor da posição: "+(i+1));
- vA[i] = sc.nextInt();
- vB[i] = vA[i]; // B recebe o mesmo valor de A
- }
- // imprimir valores A
- System.out.println("Vetor A = ");
- for(int i =0; i<vA.length;i++){
- System.out.printf(vA[i] +" ");
- }
- System.out.println("Vetor B = ");
- for(int i=0; i<vA.length;i++){
- System.out.printf(vB[i] +" ");
- }
- }
- /* CΓ©sar N. */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement