daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Dec 17th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top