Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- public class Projektor {
- int name;
- public int addition( int a, int b ){
- int c = a + b;
- return success(c);
- }
- private int success(int c) {
- System.out.println( "UDALO SIE" );
- return c;
- }
- public int subtraction( int a, int b ){
- int c = a - b;
- return success(c);
- }
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- int a = 1, b = 2, c = 3, d = 4, e = 5;
- System.out.println( "Hello World" );
- if( a == 1 )
- if( d == 4 )
- b = 3;
- else
- c = 4;
- }
- }
- public class Main {
- public static void main(String[] args){
- Random rand=new Random();
- int temp=rand.nextInt(101);
- System.out.println(temp);
- System.out.println("Zgadnij o jakiej liczbie mysle! ");
- int odczyt;
- Scanner scan = new Scanner(System.in);
- odczyt=scan.nextInt();
- if (odczyt == temp) {
- System.out.println("Winner winner chicken dinner! \n");
- } else {
- System.out.println("Niestety to nie ta, sprobuj ponownie: \n");
- }
- while(odczyt!=temp){
- System.out.println("Zgadnij o jakiej liczbie mysle! ");
- odczyt = scan.nextInt();
- if (odczyt == temp) {
- System.out.println("Winner winner chicken dinner!\n");
- } else {
- System.out.println("Niestety to nie ta, sprobuj ponownie: \n");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement