Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BonusPoints {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int chislo = scan.nextInt();
- double bonustochki = 0;
- if( chislo % 2 == 0) {
- bonustochki = 1;
- }else if(chislo % 5 ==0){
- bonustochki = 2;
- }
- if(chislo <=100) {
- bonustochki += 5;
- }else if(chislo > 100 && chislo < 1000) {
- bonustochki += chislo * 0.2;
- }else if(chislo > 1000) {
- bonustochki += chislo * 0.1;
- }
- System.out.println(bonustochki);
- System.out.println(chislo + bonustochki);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement