// 문제 6 : 물건 구매 금액 계산 (함수 활용)
// 물건 가격과 구매 개수를 입력받아
// 총 금액을 계산해서 반환하는 함수를 작성하시오.
// 함수 예: int total(int price, int count)
// 총액이 10,000원 이상이면 “배송비 무료”
// 아니면 “배송비 2500원 추가”
#include<stdio.h>
int total(int price, int count);
int main(){
int price, count;
scanf("%d %d", &price, &count);
int sum = total(price, count);
}
int total(int price, int count){
int sum = price * count;
return sum;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: