fork download
  1. import java.util.Scanner;
  2. class Main
  3. {
  4. public static void main(String[]args)
  5. {
  6. Scanner s=new Scanner(System.in);
  7. int a[]={1,1,3,4,1,3,6,9};
  8. for(int i=0;i<a.length;i++)
  9. {
  10. int c=0,k=0;
  11. for(int j=0;j<i;j++)
  12. {
  13. if(a[i]==a[j])
  14. {
  15. k=1;
  16. break;
  17. }
  18. }
  19. if(k==1)
  20. {
  21. continue;
  22. }
  23. for(int m=0;m<a.length;m++)
  24. {
  25. if(a[i]==a[m])
  26. {
  27. c++;
  28. }
  29. }
  30. System.out.println(a[i]+"="+c);
  31. }
  32. }
  33. }
Success #stdin #stdout 0.17s 60824KB
stdin
Standard input is empty
stdout
1=3
3=2
4=1
6=1
9=1