/* 돈과 인원 입력해서 더치페이 금액 출력받는 프로그램*/

#include <stdio.h>

/*

작성자: 나경문

작성날짜: 2026년 4월 2일

작성목적: 퀴즈 과제 제출

*/
int main() 
{

    printf("*****************\n");
    printf("202606017 나경문\n");
    printf("*****************\n");


    int x, y, result; // 총 금액(x)&사람 수(y) 선언 
    int thousands, rest; // 천원 단위에서 , 출력을 위해 설정
    scanf("%d %d", &x, &y);
    char c = ','; // 문자형 변수 , 선언

    result= x / y;
    thousands = result / 1000; // 더치페이 금액에서 1000원으로 나눠서 , 넣기
    rest = result % 1000;
    printf("더치페이 금액: %d%c%03d원\n", thousands, c, rest); 
    
    return 0;
}

Embed on website

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