Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package teste;
- import java.util.Scanner;
- public class outro {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int[] vetor = new int[10];
- for (int i = 0; i < 10; vetor[i++] = input.nextInt()) {}
- input.close();
- int repetidos = 0;
- int r = 0;
- for (int i = 0; i < vetor.length; i++) {
- for (int j = i+1; j < vetor.length; j++) {
- if (vetor[i] == vetor[j]) {
- repetidos++;
- r += vetor[i];
- }
- }
- }
- r /= repetidos;
- System.out.print("resultado aritmético: " + r);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment