G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 10th, 2020 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class hw1 public static void main (String args []) Scanner in = new Scanner (System.in);
  2. String gotLine = in.nextLine ();
  3. int point = gotLine.indexOf ( '.');
  4. String cutLine = gotLine.substring (0, point);
  5. System.out.println (cutLine);
  6. int blockCount = 0;
  7. char [] cutCount = cutLine.toCharArray ();
  8. for (int i = 0; i>
  9.  
  10. задача 3-ий:
  11. package massiv;
  12.  
  13. public class Main public static void main (String [] args)
  14. System.out.println ( «enther number 1-9«);
  15. Scanner b = new Scanner (System.in);
  16. int c = b.nextInt ();
  17. double e = procent (c) * 0.1;
  18. System.out.println (procent (c) + e);
  19. >
  20. public static int procent (int proc)
  21. int i;
  22. int [] a = new int [10];
  23. for (i = 0; i<10;i++)
  24. a [i] = i * 2;
  25. System.out.println ( "a [" + i + "] =" + a [i]);
  26. >
  27. return a [proc];
  28. >
  29.  
  30. import java.io.BufferedReader;
  31. import java.util. *;
  32.  
  33. public class Test1
  34.  
  35. private int numOfGaps;
  36. private String sentenceTwo;
  37.  
  38. public int getNumOfGap () return numOfGaps;
  39. >
  40.  
  41. public void go () Scanner scan = new Scanner (System.in);
  42. System.out.println ( «Введіть пропозицію, і я його прочитаю!»);
  43.  
  44. String sentence = scan.nextLine ();
  45. int index = sentence.indexOf ( «.»);
  46. sentenceTwo = sentence.substring (0, index);
  47. System.out.println ( «Перевірка:" + sentenceTwo);
  48.  
  49. for (int i = 0; i if (s == # ' # ') NumOfGaps ++;
  50. >
  51. >
  52. >
  53.  
  54. public static void main (String [] args) Test1 one = new Test1 ();
  55. one.go ();
  56. System.out.println ( "Кількість прогалин в реченні -" + one.getNumOfGap ());
  57. >
  58.  
  59. String str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. »;
  60.  
  61. int sumBarSpace = 0, sumChar = 0;
  62. char s = ',', c = '';
  63. char [] charArr = str.toCharArray ();
  64. for (int i = 0; i charArr [i] = str.charAt (i);
  65. w = charArr [i];
  66. if (w == s) break;
  67. >
  68. sumChar ++;
  69. if (w == c) sumBarSpace ++;
  70. >
  71. >
  72. System.out.println ( "Символів до знака # ', #' - "+ sumChar);
  73. System.out.println ( "Прогалин до знака # ', #' - "+ sumBarSpace);
  74. System.out.println (charArr);
  75. >
  76.  
  77. public static String recurs (String s0) String s1;
  78. System.out.print (s0.substring (s0.length () - 1));
  79. if (s0.length ()> 1)
  80. return s0;
  81. >
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