Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class FirmEx280816 {
- public static void main(String[] args) {
- Scanner scanner=new Scanner(System.in);
- int projectTime=Integer.parseInt(scanner.nextLine());
- int daysF=Integer.parseInt(scanner.nextLine());
- int peopleOverTime=Integer.parseInt(scanner.nextLine());
- int overTime=peopleOverTime*(2*daysF);
- double trainingDay=daysF-(daysF*0.1);
- double workHours=trainingDay*8;
- double allHours=Math.floor(workHours + overTime);
- if(projectTime<allHours){
- int result =(int)(allHours-projectTime);
- System.out.printf("Yes!%d hours left.", result);
- }else {
- int result2=(int)(projectTime-allHours);
- System.out.printf("Not enough time!%d hours needed.", result2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement