Advertisement
JellyJia

Untitled

Jun 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class HWarray1 {
  4.  
  5. public static void main(String[] args) {
  6. // TODO Auto-generated method stub
  7. Scanner sc = new Scanner(System.in);
  8.  
  9. String s = "fpefiajpfjei";
  10. System.out.println(s.length());
  11.  
  12. String a = "Happy";
  13. if (a.equals("Happy")) {
  14. System.out.println("YES");
  15. }
  16.  
  17. int count = 0;
  18. String b = "npadnoawnd";
  19. for(int i = 0; i<b.length(); i++) {
  20. if(b.charAt(i)=="A") {
  21. count++;
  22. }
  23. }
  24. System.out.println(count);
  25.  
  26. int count1 = 0;
  27. String c = "nosnoanncd";
  28. for(int i = 0; i<c.length(); i++) {
  29. if(c.charAt(i)=="c") {
  30. count1++;
  31. }
  32. }
  33. for(int i = 0; i<100; i++) {
  34. System.out.println("===");
  35. }
  36. for(int i = 0; i<5; i++) {
  37. System.out.println("++");
  38.  
  39. }
  40. for(int i = 0; i<11; i++) {
  41. System.out.println("HI");
  42.  
  43. }
  44. for(int i = 0; i<10; i++) {
  45. System.out.println("Yummy");
  46. }
  47. for(int i = 0; i<23; i++) {
  48. System.out.println("Bruce");
  49. }
  50. for(int i = 0; i<30; i+=5) {
  51. System.out.println(i);
  52. }
  53. for(int i = 1; i<5; i++) {
  54. System.out.println(i);
  55. }
  56.  
  57. String S = "afiewonvnos";
  58.  
  59.  
  60. for(int i = 0; i<s.length(); i++) {
  61. System.out.println(s.charAt(i));
  62. }
  63. for(int i = s.length()-1; i>=0; i--) {
  64. System.out.println(s.charAt(i));
  65. }
  66. for(int i = 1; i<7; i+=2) {
  67. for(int j = 2; j<8; j+=2) {
  68. System.out.println(i+" "+j);
  69. }
  70. }
  71.  
  72.  
  73. }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement