fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int price, person;
  5. printf("총 금액 : ");
  6. scanf("%d", &price);
  7. printf("총 인원 : ");
  8. scanf("%d", &person);
  9. printf("%d명이 각각 %d원씩 지불", person-1, price / person);
  10. printf(", 1명 %d원 지불", price - (price/person)*(person-1));
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 4400KB
stdin
10000 10
stdout
총 금액 : 총 인원 : 9명이 각각 1000원씩 지불, 1명 1000원 지불