Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package BaiToanTamHau;
- import java.util.Scanner;;
- public class Langvudaingayay {
- public static void main(String[] args)
- {
- Scanner mk = new Scanner(System.in);
- int n = mk.nextInt();
- int []A= new int [n+3];
- int i, j, Sum =0;
- for(i=0; i< n; i++)
- {
- A[i]= mk.nextInt();
- }
- for(i =0 ;i<n ;i++)
- {
- Sum +=A[i];
- for(j= i+1;j<n ;j++)
- {
- if(A[i]== A[j])
- {
- A[j]=0;
- }
- }
- }
- System.out.print(Sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement