Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Laba {
- public static void main(String [] args) {
- System.out.println("Input int");
- Scanner inp =new Scanner(System.in);
- int x=inp.nextInt();
- if(x<0) {
- System.out.println("Вы ничего не купили");
- }
- else if(x==1) {
- System.out.println("Вы купили "+x+" ноутбук.");
- }
- else if(x%10<5) {
- System.out.println("Вы купили "+x+" ноутбуа.");
- }
- else if(x%10>4 ) {
- System.out.println("Вы купили "+x+" ноутбуков.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement