Advertisement
Guest User

Untitled

a guest
Nov 13th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Practicer {
  4. //private int score = 0; ?? why can't?
  5.  
  6. public static void main(String[] args) {
  7. int score = 0;
  8. int[] sides = new int[3];
  9.  
  10. Scanner cin = new Scanner(System.in);
  11.  
  12. while(cin.hasNext()){
  13. for(int i=0;i<3;i++){
  14. sides[i] = cin.nextInt();
  15. }
  16.  
  17. Arrays.sort(sides);
  18.  
  19. if((sides[0]+sides[1]) > sides[2]){
  20. score++;
  21. }
  22.  
  23. }
  24. System.out.println(score);
  25. }
  26. }
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement