일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- VARIABLE
- Algorithm
- c#
- SWEA
- SWEA파이썬
- 리터럴
- 코드업
- 변수
- 코딩테스트
- 프로그래머스파이썬
- Literal
- 수학연산
- 백준파이썬
- 코드업자바
- 사용자입력
- 제어구조
- 자바연산자
- Java
- 자바
- 디자인패턴
- C#프로그래밍
- 코드업100제
- 백준
- 알고리즘
- 코드업100제자바
- 자바클래스
- 기초프로그래밍
- Codeup
- C#변수
- 개발입문
- Today
- Total
목록코드업100제 (12)
제니노트
1071 정수가 순서대로 입력된다. -2147483648 ~ +2147483647, 단 개수는 알 수 없다. 0이 아니면 입력된 정수를 출력하고, 0이 입력되면 출력을 중단해보자. while( ), for( ), do~while( ) 등의 반복문을 사용할 수 없다. 참고 goto 명령문을 사용하면 간단한 반복 실행을 만들 수 있다. 반복 실행 부분을 빠져나오기 위해(즉 무한 반복을 방지하기 위해) 반복 실행 되는 도중에 조건을 검사해야 한다. goto 이름: 이 명령은 이름: 이 작성된 곳으로 프로그램의 실행 흐름을 바꾸어 준다. "이름:" 과 같이 콜론(:)이 붙어있는 부분을 이름표(label, 레이블)라고 한다. 레이블은 특별한 선언 없이 사용할 수 있으며 언더바(_)나 영문자로 시작하면 된다. 레이..
1065 세 정수 a, b, c가 입력되었을 때, 짝수만 출력해보자. import java.io.*; import java.util.StringTokenizer; public class Main{ public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); StringTokenizer st = new StringTokenizer(str," "); int a = Integer.parseInt(st.nextToken()); int b = Integer.parseInt(st.nextTo..
1063 입력된 두 정수 a, b 중 큰 값을 출력하는 프로그램을 작성해보자. 단, 조건문을 사용하지 않고 3항 연산자 ? 를 사용한다. import java.io.*; import java.util.StringTokenizer; public class Main{ public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); StringTokenizer st = new StringTokenizer(str," "); int a = Integer.parseInt(st.nextToken(..
1059 import java.io.*; public class Main{ public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); int a = Integer.parseInt(str); System.out.print(~a); } } 1060 입력된 정수 두 개를 비트단위로 and 연산한 후 그 결과를 정수로 출력해보자. 비트단위(bitwise)연산자 &를 사용하면 된다.(and, ampersand, 앰퍼센드라고 읽는다.) import java.io.*; import java...
1053 1(true, 참) 또는 0(false, 거짓) 이 입력되었을 때 반대로 출력하는 프로그램을 작성해보자. import java.io.*; public class Main{ public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); int a = Integer.parseInt(str); if(a==1) { System.out.print("0"); } else { System.out.print("1"); } } } 1054 두 개의 참(1) 또는 거짓(0)이 입력될 때, 모..
1049 두 정수(a, b)를 입력받아 a가 b보다 크면 1을, a가 b보다 작거나 같으면 0을 출력하는 프로그램을 작성해보자. import java.io.*; import java.util.*; //1049 public class Main{ public static void main(String args[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()," "); int a = Integer.parseInt(st.nextToken()); int b = Integer.parseInt(..
1047 정수 1개를 입력받아 2배 곱해 출력해보자. import java.io.*; import java.util.*; //1047 public class Main{ public static void main(String args[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int a = Integer.parseInt(br.readLine()); System.out.println(a
1038 정수 2개를 입력받아 합을 출력하는 프로그램을 작성해보자. (단, 입력되는 정수는 -1073741824 ~ 1073741824 이다.) import java.io.*; import java.util.*; //1038 public class Main{ public static void main(String args[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String two =br.readLine(); StringTokenizer st= new StringTokenizer(two," "); int a = Integer.parseInt(st.nextToken()); ..