Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class HuxleyCode {
  5. public static void main(String args[]) {
  6. Scanner in=new Scanner(System.in);
  7. double F=in.nextInt();
  8. double P=in.nextInt();
  9. String S="";
  10. String R="Pell, voe e traga mais comida ou a festa sera arruinada!";
  11. double contfome=0;
  12. do {
  13. S=in.nextLine();
  14. P=P-1;
  15. if(S.equals("Arroz")) {
  16. contfome=contfome+25;
  17. }
  18. if(S.equals("Churrasco de Animal do Mar")) {
  19. contfome=contfome+100;
  20. }
  21. if(S.equals("Paella Vestido de Camarao")){
  22. contfome=contfome+70;
  23. }
  24. if(S.equals("Massa de Tinta de Lula Rosa")) {
  25. contfome=contfome+55;
  26. }
  27. if(S.equals("Mizu Mizu Doces")) {
  28. contfome=contfome+15;
  29. }
  30. }while(P!=-1);
  31. F=F-contfome;
  32. if(F<=0) {
  33. R="Sucesso, vamos todos celebrar.";
  34. System.out.printf("%s",R);
  35. }
  36. if(F>0) {
  37. System.out.printf("%s",R);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement