Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- */
- /**
- * @author Ilian Dimitrov
- *
- */
- package confSS;
- import java.util.Scanner;
- public class math {
- private static Scanner input;
- private static double firstPrecent;
- private static double secoundPrecent;
- private static int even;
- private static int Under;
- private static int lastDigitAdd;
- public static void main(String[] args) {
- input = new Scanner(System.in);
- int points = input.nextInt();
- int lastDigit = points % 10;
- setEven(1);
- setUnder(5);
- setLastDigitAdd(2);
- setFirstPrecent((points * 20 / 100) + points);
- setSecoundPrecent(((points * 10 / 100) + points));
- if (points <= 100) {
- if (points % 2 == 0) {
- System.out.println(points + Under + even);
- } else if (lastDigit == 5) {
- System.out.println(points + Under + lastDigitAdd);
- } else {
- System.out.println(points + Under);
- }
- } else if (points > 100 && points <= 1000) {
- if (points % 2 == 0) {
- System.out.println(firstPrecent + even);
- } else if (lastDigit == 5) {
- System.out.println(firstPrecent + lastDigitAdd);
- } else {
- System.out.println(firstPrecent);
- }
- } else if (points > 1000) {
- if (points % 2 == 0) {
- System.out.println(secoundPrecent + even);
- } else if (lastDigit == 5) {
- System.out.println(secoundPrecent + lastDigitAdd);
- } else {
- System.out.println(secoundPrecent);
- }
- }
- }
- public static double getFirstPrecent() {
- return firstPrecent;
- }
- public static void setFirstPrecent(double firstPrecent) {
- math.firstPrecent = firstPrecent;
- }
- public static double getSecoundPrecent() {
- return secoundPrecent;
- }
- public static void setSecoundPrecent(double secoundPrecent) {
- math.secoundPrecent = secoundPrecent;
- }
- public static int getEven() {
- return even;
- }
- public static void setEven(int even) {
- math.even = even;
- }
- public static int getUnder() {
- return Under;
- }
- public static void setUnder(int under) {
- math.Under = under;
- }
- public static int getLastDigitAdd() {
- return lastDigitAdd;
- }
- public static void setLastDigitAdd(int lastDigitAdd) {
- math.lastDigitAdd = lastDigitAdd;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement