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