コードベース100題(51~60)

3653 ワード


1051
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        int ret;
        if(n1 <= n2){
            ret = 1;
        }else{
            ret = 0;
        }
        System.out.print(ret);
    }
}
1052
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        int ret;
        if(n1 != n2){
            ret = 1;
        }else{
            ret = 0;
        }
        System.out.print(ret);
    }
}
1053
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        if(n1 == 0) {
            System.out.print(1);
        }else{
            System.out.print(0);
        }
    }
}
1054
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        if(n1 == 1 & n2 == 1) {
            System.out.print(1);
        }else{
            System.out.print(0);
        }
    }
}
1055
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        if(n1 == 1 | n2 == 1) {
            System.out.print(1);
        }else{
            System.out.print(0);
        }
    }
}
1056
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        if(n1 != n2 ) {
            System.out.print(1);
        }else{
            System.out.print(0);
        }
    }
}
1057
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        if(n1 == n2 ) {
            System.out.print(1);
        }else{
            System.out.print(0);
        }
    }
}
1058
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        if(n1 == 0 & n2 == 0 ) {
            System.out.print(1);
        }else{
            System.out.print(0);
        }
    }
}
1059
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        System.out.print(~n1);
    }
}
1060
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        System.out.print(n1&n2);
    }
}