Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- public class HuxleyCode {
- public static void main(String args[]) {
- Scanner in=new Scanner(System.in);
- double F=in.nextInt();
- double P=in.nextInt();
- String S="";
- String R="Pell, voe e traga mais comida ou a festa sera arruinada!";
- double contfome=0;
- do {
- S=in.nextLine();
- P=P-1;
- if(S.equals("Arroz")) {
- contfome=contfome+25;
- }
- if(S.equals("Churrasco de Animal do Mar")) {
- contfome=contfome+100;
- }
- if(S.equals("Paella Vestido de Camarao")){
- contfome=contfome+70;
- }
- if(S.equals("Massa de Tinta de Lula Rosa")) {
- contfome=contfome+55;
- }
- if(S.equals("Mizu Mizu Doces")) {
- contfome=contfome+15;
- }
- }while(P!=-1);
- F=F-contfome;
- if(F<=0) {
- R="Sucesso, vamos todos celebrar.";
- System.out.printf("%s",R);
- }
- if(F>0) {
- System.out.printf("%s",R);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement