목록Algorithm (5)
Interstellar
[문자열] 1152 - 단어의 개수 문제유형 : 문자열 문제번호 : 1152 문제이름 : 단어의 개수 문제주소 : https://www.acmicpc.net/problem/1152 해결아이디어 : 기본적인 문자열 처리 문제, 예외 처리 Python print(len(input().split())) Java import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); String inValue =..
[조건문] 9498 - 시험 성적 문제유형 : 조건문문제번호 : 9498문제이름 : 시험성적문제주소 : https://www.acmicpc.net/problem/9498 해결아이디어 : 기본적인 조건문 문제, ASCII 코드 이용 Pythonn=int(input())if n>89:print('A')elif n>79:print('B')elif n>69:print('C')elif n>59:print('D')else:print('F') n=int(input())if(n==100):print('A')elif(n= 90) {out.print("A");} else if (inValue >= 80) {out.print("B");} else if (inValue >= 70) {out.print("C");} else i..
[반복문] 2741 - N 찍기 문제유형 : 반복문문제번호 : 2741문제이름 : N 찍기문제주소 : https://www.acmicpc.net/problem/2741 해결아이디어 : 기본적인 for문 문제 PythoninValue = int(input());for i in range(inValue):print(i+1) Javaimport java.io.*; class Main{public static void main(String[] args) throws IOException {BufferedReader br = new BufferedReader(new InputStreamReader(System.in));int num = Integer.parseInt(br.readLine());for(int i=1..
[입출력] 1000 - A+B 문제유형 : 입력문제번호 : 1000문제이름 : A+B문제주소 : https://www.acmicpc.net/problem/1000 해결아이디어 : 기본적인 입출력 문제 PythoninValue = input() // '1 2'inValueSplit1, inValueSplit2 = inValue.split() // '1', '2'outValue = int(inValueSplit1) + int(inValueSplit2) // 1+2 = 3 print(outValue) print(sum(map(int, input().split()))) // short coding Javaimport java.io.BufferedReader;import java.io.IOException;imp..
[입출력] 2557 - Hello World 문제유형 : 출력문제번호 : 2557문제이름 : Hello World문제주소 : https://www.acmicpc.net/problem/2557 해결아이디어 : 기본적인 출력 문제 Pythonprint("Hello World!") Javaclass Main{public static void main(String[] args){System.out.println("Hello World!");}} 코멘트 :Java는 Python과 다르게 Class - main function 형태를 직접 구현해줘야 한다. 해당 구조를 자주 쓰다보면 익숙하겠지만 Python에 익숙해서 그런지 아직은 좀 불편하다.