//// Q 1046
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// int x = t.nextInt();
// int y = t.nextInt();
// int z = t.nextInt();
// System.out.println(x+y+z);
// System.out.printf("%.1f", (double)(x+y+z)/3);
// }
//}
////Q 1113
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// int x = t.nextInt();
// int y = t.nextInt();
// System.out.print(y);
// System.out.print(" " + x);
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// int x = t.nextInt();
// System.out.print(x * 24);
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// int x = t.nextInt();
// int y = t.nextInt();
// System.out.print(x + y);
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// long x = t.nextLong();
// long y = t.nextLong();
// System.out.print(x+y);
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// int x = t.nextInt();
// int y = t.nextInt();
// System.out.println(x + "+" + y + "=" + (x+y));
// System.out.println(x + "-" + y + "=" + (x-y));
// System.out.println(x + "*" + y + "=" + (x*y));
// System.out.println(x + "/" + y + "=" + (x/y));
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// float x = t.nextFloat();
// float y = t.nextFloat();
// System.out.printf("%.2f", x*y);
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// int x = t.nextInt();
// int y = t.nextInt();
// System.out.printf("%.1f", (double)(x*y)/2);
// }
//}
/*
* 삼항연산자:
* 3번째 variable을 if (condition) true, save variable as (pre-set value 1) - if else (condition not true), save variable as (pre-set value 2)
* written as:
*
* int z = (condition) ? ("if true" value 1) : ("if else" value 2);
* import java.util.*;
example code:
public class Main {
public static void main(String[] args) {
Scanner t = new Scanner(System.in);
int x = t.nextInt();
int y = t.nextInt();
// in python!!!
* z = ( x - y ) if (x > y ) else (y - x)
int z = ( x > y ) ? ( x - y ) : ( y - x );
System.out.println(z);
}
}
*/
//// 1063
//import java.util.Scanner;
//
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int y = t.nextInt();
// int z = (x>y) ? (x) : (y);
// System.out.print(z);
// }
//}
//// 1064
//import java.util.Scanner;
//
//public class Main {
// public static void main(String [] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int y = t.nextInt();
// int z = t.nextInt();
// int a = (((x>y)?(y):(x)) > z) ? (z) : ((x>y?(y):(x)));
// System.out.print(a);
// }
//}
//
//import java.util.Scanner;
//
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int y = t.nextInt();
// int z = (x>y) ? (1) : (0);
// // if x is bigger than y, save z as 1. if else (y is bigger than x) then save z as 0.
//
// System.out.print(z);
// }
//}
//
//// 1050
//import java.util.Scanner;
//
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int y = t.nextInt();
// int z = (x==y) ? (1) : (0);
//
// System.out.print(z);
// }
//}
//// 1051
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int y = t.nextInt();
// int z = (y>=x) ? (1) : (0);
//
// System.out.print(z);
// }
//}
//// 1052
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
// int x = t.nextInt();
// int y = t.nextInt();
// int z = (x != y) ? (1) : (0);
//
// System.out.print(z);
// }
//}
/*
* Logical Operators:
* USED WITH BOOLEAN, WHICH SHOWS TRUE/FALSE (but need to change into 0 and 1 every time printing)
*
* and = &&
* example:
* a && b
*
* or = || <- the Won sign on right of keyboard
* example:
* a || b
*
* not = !
* example:
* !(a && b) !a
*
*
* example:
import java.util.*; // * is allowing every utility to be used (for laziness, takes up space)
public class Main {
public static void main(String[] args) {
Scanner t = new Scanner(System.in);
int x = t.nextInt();
int y = t.nextInt();
boolean bx = (x == 1) ? true : false; // if input of x is 1, save bx as true... if else, save bx as false
boolean by = (y == 1) ? true : false; // if input of y is 1, save by as true... if else, save by as false
boolean bz = bx && by; // if both bx and by is true, save bz as true... if else, save bz as false
int z = (bz == true) ? 1 : 0; // change the bz into 1 and 0 because default boolean is true/false
System.out.println(b);
}
}
*
*/
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int z = (x == 1) ? (0) : (1);
// System.out.print(z);
//
//// boolean bx = x == 1 ? true: false;
//// boolean bz = (bx == true) ? false : true;
//// i have no idea how the code above works lol the teacher did it and its supposed to work the same but it doesn't so idk :(
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int y = t.nextInt();
// int z = (x == 1) && (y == 1) ? 1 : 0;
// System.out.print(z);
// }
//}
//import java.util.Scanner;
//public class Main {
// public static void main(String[] args) {
// Scanner t = new Scanner (System.in);
//
// int x = t.nextInt();
// int y = t.nextInt();
//
// int z = (x == 1) || (y ==1) ? (1) : (0);
//
// System.out.print(z);
// }
//}top of page

실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
20240526
20240526
댓글 0개
좋아요
댓글(0)
더 이상 게시물에 대한 댓글 기능이 지원되지 않습니다. 자세한 사항은 사이트 소유자에게 문의하세요.
bottom of page


