SHARE
TWEET

Untitled

a guest Jun 16th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class ccc13j2 {
  4.  
  5.     public static void main(String[] args) {
  6.         // TODO Auto-generated method stub
  7. Scanner sc = new Scanner(System.in);
  8. String S = sc.next();
  9. S = S.replace("I","");
  10. S = S.replace("O","");
  11. S = S.replace("S","");
  12. S = S.replace("H","");
  13. S = S.replace("Z","");
  14. S = S.replace("X","");
  15. S = S.replace("N","");
  16. if(S.length()==0) {
  17. System.out.println("YES");
  18. } else {
  19.     System.out.println("NO");
  20.  
  21. import java.util.Scanner;
  22.  
  23. public class ccc09j2 {
  24.  
  25.     public static void main(String[] args) {
  26.         // TODO Auto-generated method stub
  27.         Scanner sc = new Scanner(System.in);
  28.         int troutP = sc.nextInt();
  29.         int pikeP = sc.nextInt();
  30.         int pickerelP = sc.nextInt();
  31.         int total = sc.nextInt();
  32.  
  33.         int maxtrout = total/troutP;
  34.         int maxpike = total/pikeP;
  35.         int maxpickerel = total/pickerelP;
  36.  
  37.         int count = 0;
  38.         for (int f1=0; f1<=maxtrout; f1++) {
  39.             for (int f2=0; f2<=maxpike; f2++) {
  40.                 for (int f3=0; f3<=maxpickerel; f3++) {       // !=means no equal
  41.                     if (f1*troutP+f2*pikeP+f3*pickerelP<=total && f1+f2+f3!=0) {
  42.  
  43.                         System.out.println(f1+" Brown trout," +f2+ " Nothern pike," + f3 +" Yellow pickel");
  44.                         count++;   
  45.                     }
  46.                 }
  47.             }
  48.  
  49.         }
  50. System.out.println("number of ways to catch fish:"+count);
  51.    
  52. }
  53. }
  54.  
  55. import java.util.Scanner;
  56.  
  57. public class ccc07j2 {
  58.  
  59.     public static void main(String[] args) {
  60.         // TODO Auto-generated method stub
  61.         Scanner sc = new Scanner(System.in);
  62.         while (true) { 
  63.             String S = sc.next();
  64.             if (S.equals("CU")) {
  65.                 System.out.println("see you");
  66.             }else if (S.equals(":-)")) {
  67.                 System.out.println("I'm happy");
  68.             }else if (S.equals(":-(")) {
  69.                 System.out.println("I'm unhappy");
  70.             }else if (S.equals(";-)")) {
  71.                 System.out.println("wink");
  72.             }else if (S.equals(":-P")) {
  73.                 System.out.println("stick out my tougue"); 
  74.             }else if (S.equals("(~.~)")) {
  75.                 System.out.println("sleepy");
  76.             }else if (S.equals("TA")) {
  77.                 System.out.println("tottally awesome");
  78.             }else if (S.equals("CCC")) {
  79.                 System.out.println("Canadian Computing Competition\n");
  80.             }else if (S.equals("CUZ")) {
  81.                 System.out.println("because");
  82.             } else if (S.equals("TY")) {
  83.                 System.out.println("thank-you");
  84.             }  else if (S.equals("YW")) {
  85.                 System.out.println("you are welcome"); 
  86.             }else if (S.equals("TTYL")) {
  87.                 System.out.println("talk to you later");
  88.             }else {
  89.                 System.out.println(S);
  90.  
  91.             }
  92.         }
  93.     }
  94. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top