/* 주차시간 입력하고 주차요금 출력하는 프로그램*/

#include <stdio.h>
/*

작성자: 나경문

작성날짜: 2026년 3월 12일

작성목적: 퀴즈 과제 제출

*/
int main() {
    printf("****************\n");
    printf("26학번 나경문\n");
    printf("****************\n");
    int minute;     //주차시간 입력
    scanf("%d", &minute);
    if (minute<15) 
        printf("무료 출차입니다"); // 15분 미만이면 무료로 출력
        else if (minute==15)
        printf("2000원입니다"); // 15분이면 2000원
      else if (minute>15) {
          int pay;
        scanf("%d", &pay);
       pay= 2000 + ((minute-15)/10) * 1000;
        printf("%d원입니다.", pay);
      }
     
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: