C/정올 Language_Coder
정올 C - 530번 선택제어문 - 자가진단3
문제 : http://www.jungol.co.kr/bbs/board.php?bo_table=pbank&wr_id=167&sca=1050 JUNGOL www.jungol.co.kr 문제 나이를 입력받아 20살 이상이면 "adult"라고 출력하고 그렇지 않으면 몇 년후에 성인이 되는지를 "○ years later"라는 메시지를 출력하는 프로그램을 작성하시오. 입력 예 18 출력 예 2 years later 코드 : # include int main() { int age,num; scanf("%d",&age); if(age >= 20) printf("adult"); else if(age < 20) { num = 20 - age; printf("%d years later",num); } }
2020. 7. 25. 00:55
최근댓글