myrdok123

05. Salary

May 21st, 2023
959
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package L04_ForLoop;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P05_Salary {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int tabs = Integer.parseInt(scanner.nextLine());
  10.         int salary = Integer.parseInt(scanner.nextLine());
  11.  
  12.         for (int i = 1; i <=tabs ; i++) {
  13.  
  14.             String websiteName = scanner.nextLine();
  15.  
  16.  
  17.             //todo -> проверка за име на сайта - намалене на заплата
  18.  
  19.             if(salary <= 0){
  20.                 System.out.println("You have lost your salary.");
  21.                 break;
  22.             }
  23.  
  24.         }
  25.  
  26.         //todo -> проверка дали заплатата е над -> 0
  27.  
  28.  
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment