fork download
  1. import java.util.*;
  2. class Movie{
  3. String mn;
  4. String c;
  5. String g;
  6. int b;
  7. Movie(String m,String c,String g,int b){
  8. mn = m;
  9. this.c = c;
  10. this.g = g;
  11. this.b = b;
  12. }
  13.  
  14.  
  15. String getmn(){
  16. return mn;
  17. }
  18. String getc(){
  19. return c;
  20. }
  21. String getg(){
  22. return g;
  23. }
  24. int getb(){
  25. return b;
  26. }
  27. }
  28. class solution
  29.  
  30. {
  31. public static void main(String[] args)
  32. {
  33. Scanner sc=new Scanner(System.in);
  34. Movie obj[] = new Movie[4];
  35. for(int i = 0 ; i<4 ; i++){
  36. String a = sc.nextLine();
  37. String b = sc.nextLine();
  38. String c = sc.nextLine();
  39. int d = sc.nextInt(); sc.nextLine();
  40.  
  41. obj[i] = new Movie(a,b,c,d);
  42.  
  43. }
  44. String x = sc.nextLine();
  45. Movie xx[] = getMovieByGenre(obj , x);
  46. int v = 0 ;
  47. while(xx[v]!=null){
  48. if(xx[v].getb()>80000000){
  49. System.out.println("High Budget Movie");
  50. }else{
  51. System.out.println("Low Budget Movie");
  52. }
  53. v++;
  54. }
  55. }
  56. static Movie[] getMovieByGenre(Movie obj[] , String g){
  57. Movie ob[] = new Movie[4];
  58. int j = -1;
  59. for(int i = 0 ; i<4 ; i++){
  60. if(obj[i].getg().equals(g)){
  61. j++;
  62. ob[j] = obj[i];
  63. }
  64. }
  65. return ob;
  66. }
  67. }
  68.  
  69.  
Success #stdin #stdout 0.13s 56632KB
stdin
aaa
Marvel
Action
250000000
bbb
Marvel
Comedy
25000000
ccc
Marvel
Comedy
2000000
ddd
Marvel
Action
300000000
Action
stdout
High Budget Movie
High Budget Movie