Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package loopsForDraw;
- import java.util.Scanner;
- public class games_p_04 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int num = Integer.parseInt(scan.nextLine());
- double firstSelector = 0;
- double secondSelector = 0;
- double thirtSelector = 0;
- double fourtySelector = 0;
- double fiveSelector = 0;
- double higetsOrLower = 0;
- for (int i = 0; i < num; i++) {
- int currentNum = Integer.parseInt(scan.nextLine());
- if (currentNum >= 0 && currentNum <= 9) {
- firstSelector = currentNum * 0.2;
- } else if (currentNum >= 10 && currentNum <= 19) {
- secondSelector = currentNum * 0.3;
- } else if (currentNum >= 20 && currentNum <= 29) {
- thirtSelector = currentNum * 0.4;
- } else if (currentNum >= 30 && currentNum <= 39) {
- fourtySelector = currentNum + 50;
- } else if (currentNum >= 40 && currentNum < 50) {
- firstSelector = currentNum + 100;
- } else if (currentNum < 0 && currentNum >= 50) {
- higetsOrLower = currentNum * (100 / 2);
- }
- }
- System.out.println(firstSelector);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment