Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main(void) {
- int income, taxLength, i;
- char strTax[100], *taxPointer;
- double tax;
- printf("총 소득(원)을 입력하세요 : ");
- scanf("%d", &income);
- if(income <= 10000000) {
- tax = income * 0.08;
- }
- else if(income > 10000000 && income <= 40000000) {
- tax = income * 0.17;
- }
- else if(income > 40000000 && income <= 80000000) {
- tax = income * 0.26;
- }
- else {
- tax = income * 0.35;
- }
- tax = (int)(tax + 0.5);
- tax = ((int)tax / 10) * 10;
- sprintf(strTax, "%d", (int)tax);
- taxLength = strlen(strTax);
- taxPointer = strTax;
- printf("%c", taxPointer);
- printf("최종 부과세금 : ");
- for(i = taxLength; i > 0;) {
- printf("%c", *taxPointer++);
- i--;
- if(i > 0 && i % 3 == 0) {
- printf(",");
- }
- }
- printf("\n");
- }
Add Comment
Please, Sign In to add comment