Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Random;
  3.  
  4.  
  5. public class Projektor {
  6. int name;
  7.  
  8. public int addition( int a, int b ){
  9. int c = a + b;
  10. return success(c);
  11.  
  12. }
  13.  
  14.  
  15. private int success(int c) {
  16. System.out.println( "UDALO SIE" );
  17. return c;
  18. }
  19.  
  20.  
  21. public int subtraction( int a, int b ){
  22. int c = a - b;
  23. return success(c);
  24.  
  25. }
  26.  
  27.  
  28. /**
  29. * @param args
  30. */
  31. public static void main(String[] args) {
  32. // TODO Auto-generated method stub
  33. int a = 1, b = 2, c = 3, d = 4, e = 5;
  34. System.out.println( "Hello World" );
  35.  
  36.  
  37. if( a == 1 )
  38. if( d == 4 )
  39. b = 3;
  40. else
  41. c = 4;
  42. }
  43.  
  44. }
  45.  
  46. public class Main {
  47.  
  48. public static void main(String[] args){
  49.  
  50. Random rand=new Random();
  51. int temp=rand.nextInt(101);
  52.  
  53. System.out.println(temp);
  54. System.out.println("Zgadnij o jakiej liczbie mysle! ");
  55.  
  56. int odczyt;
  57. Scanner scan = new Scanner(System.in);
  58. odczyt=scan.nextInt();
  59.  
  60. if (odczyt == temp) {
  61. System.out.println("Winner winner chicken dinner! \n");
  62. } else {
  63. System.out.println("Niestety to nie ta, sprobuj ponownie: \n");
  64. }
  65.  
  66. while(odczyt!=temp){
  67. System.out.println("Zgadnij o jakiej liczbie mysle! ");
  68. odczyt = scan.nextInt();
  69. if (odczyt == temp) {
  70. System.out.println("Winner winner chicken dinner!\n");
  71. } else {
  72. System.out.println("Niestety to nie ta, sprobuj ponownie: \n");
  73. }
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement