일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- 딥러닝
- 반복실행구조
- bitwise
- codeup
- 8진수
- 진수
- 2진수
- 파이썬
- 입출력
- Docker
- 산술연산
- 문자열
- 선택실행구조
- 비교연산
- face recognition
- 논리연산
- 불 자료형
- 종합
- OpenCV
- 16진수
- input()
- 코드업
- 비트단위논리연산
- 기초 100제
- 2차원배열
- 10진수
- 출력
- 불 연산
- 기초100제
- 아스키코드
- Today
- Total
목록
728x90
반응형
SMALL
입출력 (18)
DeepFlowest
문제 : 주민번호는 다음과 같이 구성된다. XXXXXX-XXXXXXX 앞의 6자리는 생년월일(yymmdd)이고 뒤 7자리는 성별, 지역, 오류검출코드이다. 주민번호를 입력받아 형태를 바꿔 출력해보자. 답 : 설명 : 여러항목 출력 콤마(,)로 구분하면, 문자, 숫자 상관없이 일정공백을 사이에 두고 출력 플러스(+)를 쓰면, 문자끼리는 공백없이 이어져서 출력이 되고, 숫자끼리는 합산된다. 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub. github.com
문제 : 년, 월, 일을 입력받아 지정된 형식으로 출력하는 연습을 해보자. 답 : 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub. github.com
문제 : 어떤 형식에 맞추어 시간이 입력될 때, 그대로 출력하는 연습을 해보자. 답 : 방법1 방법2 설명 : sep 구분자 print(값1, 값2, sep='문자 또는 문자열') print(변수1, 변수2, sep='문자 또는 문자열') 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub. github.com
문제 : int형 정수 1개를 입력받아 공백을 사이에 두고 3번 출력해보자. 답 : 방법1 방법2 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub. github.com
문제 : 실수(float) 1개를 입력받아 저장한 후, 저장되어 있는 값을 소수점 셋째 자리에서 반올림하여 소수점 이하 둘 째 자리까지 출력하시오. 답 : 설명 : '%.자릿수f' % 숫자 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub. github.com
문제 : 2개의 문자(ASCII CODE)를 입력받아서 순서를 바꿔 출력해보자. 답 : 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub. github.com
문제 : 답 : 설명 : input 한 번에 값을 여러 개 입력 받으려면 split()을 사용해 공백을 기준으로 나눠주면 된다. 변수1, 변수2 = input().split() 변수1, 변수2 = input().split('기준문자열') 변수1, 변수2 = input('문자열').split() 변수1, 변수2 = input('문자열').split('기준문자열') 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub. github.com
문제 : 실수형(float)로 변수를 선언하고 그 변수에 실수값을 저장한 후 저장되어 있는 실수값을 출력해보자. 답 : 방법1 방법2 설명 : 1. 출력할 때 print(a)를 하게 되면 잘못된 풀이라고 뜬다. => 출력 예시가 소수점 6자리까지 이므로 맞춰줘야 한다. 2. %f는 무조건 소수점 6자리까지 맞추는 서식문자이기 때문에 print("%f" % a)를 쓴다. %f : 실수형 %d : 정수형 %s : 문자열 %c : 문자 1개 코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp Yearang-Lee/Algorithm Contribute to Yearang-Lee/Algorithm development by creating an ac..