Guest User

Untitled

a guest
Dec 17th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. package javaapplication42;
  2. import java.util.*;
  3.  
  4.  
  5.  
  6.  
  7. public class JavaApplication42 {
  8.  
  9.  
  10. public static void main(String[] args) {
  11.  
  12. Scanner sc = new Scanner(System.in);
  13. while (sc.hasNext()){
  14. int n =sc.nextInt();
  15. int x=0;
  16. if(n>=40){
  17. x=100;
  18. }else if(n>20 ){
  19. x=80 + (n-20);
  20. }else if(n>10){
  21. x = 60 + 2*(n-10);
  22. }else{
  23. x = n *6;
  24. }
  25. System.out.println(x);
  26.  
  27.  
  28. }//while input end
  29. }
  30. }
Add Comment
Please, Sign In to add comment