Q51
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] str1 = str.split(" ");
int a = Integer.parseInt(str1[0]);
int b = Integer.parseInt(str1[1]);
if(a<=b) {
System.out.println(1);
} else
System.out.println(0);
}
}
Q52
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] str1 = str.split(" ");
int a = Integer.parseInt(str1[0]);
int b = Integer.parseInt(str1[1]);
if(a!=b) {
System.out.println(1);
} else
System.out.println(0);
}
}
Q53
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
int i = scanner.nextInt();
if(!(i==0||i==1)) return;
else if(i==0) {
i=1;
}
else i=0;
System.out.println(i);
}
}
Q54
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] str1 = str.split(" ");
int a = Integer.parseInt(str1[0]);
int b = Integer.parseInt(str1[1]);
int i =0;
if(!((a==0||a==1)&&(b==0||b==1))) return;
else if(a==1&&b==1) {
i=1;
}
else i=0;
System.out.println(i);
}
}
Q55
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] str1 = str.split(" ");
int a = Integer.parseInt(str1[0]);
int b = Integer.parseInt(str1[1]);
int i =0;
if(!((a==0||a==1)&&(b==0||b==1))) return;
if(a==0&&b==0) {
i=0;
}
else i=1;
System.out.println(i);
}
}
Q56
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] str1 = str.split(" ");
int a = Integer.parseInt(str1[0]);
int b = Integer.parseInt(str1[1]);
int i =0;
if(!((a==0||a==1)&&(b==0||b==1))) return;
if(a!=b) {
i=1;
}
else i=0;
System.out.println(i);
}
}
Q57
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] str1 = str.split(" ");
int a = Integer.parseInt(str1[0]);
int b = Integer.parseInt(str1[1]);
int i =0;
if(!((a==0||a==1)&&(b==0||b==1))) return;
if(a==b) {
i=1;
}
else i=0;
System.out.println(i);
}
}
Q58
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] str1 = str.split(" ");
int a = Integer.parseInt(str1[0]);
int b = Integer.parseInt(str1[1]);
int i =0;
if(!((a==0||a==1)&&(b==0||b==1))) return;
if(a==0&&b==0) {
i=1;
}
else i=0;
System.out.println(i);
}
}
Q59
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
int i = scanner.nextInt();
System.out.println(~i);
}
}
Q60
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String[] i=str.split(" ");
int v1=Integer.parseInt(i[0]);
int v2=Integer.parseInt(i[1]);
System.out.println(v1&v2);
}
}
'Study > CodeUp기초100제' 카테고리의 다른 글
CodeUp 71~80 (0) | 2023.03.29 |
---|---|
CodeUp 61~70 (0) | 2023.03.28 |
CodeUp 41~50 (0) | 2023.03.24 |
CodeUp 31~40 (0) | 2023.03.23 |
CodeUp 21~30 (0) | 2023.03.22 |
댓글