#include <stdio.h>
int main() {
float sales, salary, commission, social_security, total_income;
// รับข้อมูลจากผู้ใช้
printf("กรุณาใส่เงินเดือน: ");
// คำนวณค่าคอมมิชชั่นและค่าประกันสังคม
commission = sales * 0.30;
social_security = salary * 0.03;
// คำนวณรายได้รวม
total_income = salary + commission - social_security;
// แสดงผลลัพธ์
printf("ค่าคอมมิชชั่น: %.2f บาท\n", commission
); printf("ค่าประกันสังคม: %.2f บาท\n", social_security
); printf("รายได้รวม: %.2f บาท\n", total_income
);
return 0;
}
CiNpbmNsdWRlIDxzdGRpby5oPgoKaW50IG1haW4oKSB7CiAgICBmbG9hdCBzYWxlcywgc2FsYXJ5LCBjb21taXNzaW9uLCBzb2NpYWxfc2VjdXJpdHksIHRvdGFsX2luY29tZTsKCiAgICAvLyDguKPguLHguJrguILguYnguK3guKHguLnguKXguIjguLLguIHguJzguLnguYnguYPguIrguYkKICAgIHByaW50Zigi4LiB4Lij4Li44LiT4Liy4LmD4Liq4LmI4Lii4Lit4LiU4LiC4Liy4LiiOiAiKTsKICAgIHNjYW5mKCIlZiIsICZzYWxlcyk7CiAgICBwcmludGYoIuC4geC4o+C4uOC4k+C4suC5g+C4quC5iOC5gOC4h+C4tOC4meC5gOC4lOC4t+C4reC4mTogIik7CiAgICBzY2FuZigiJWYiLCAmc2FsYXJ5KTsKCiAgICAvLyDguITguLPguJnguKfguJPguITguYjguLLguITguK3guKHguKHguLTguIrguIrguLHguYjguJnguYHguKXguLDguITguYjguLLguJvguKPguLDguIHguLHguJnguKrguLHguIfguITguKEKICAgIGNvbW1pc3Npb24gPSBzYWxlcyAqIDAuMzA7CiAgICBzb2NpYWxfc2VjdXJpdHkgPSBzYWxhcnkgKiAwLjAzOwoKICAgIC8vIOC4hOC4s+C4meC4p+C4k+C4o+C4suC4ouC5hOC4lOC5ieC4o+C4p+C4oQogICAgdG90YWxfaW5jb21lID0gc2FsYXJ5ICsgY29tbWlzc2lvbiAtIHNvY2lhbF9zZWN1cml0eTsKCiAgICAvLyDguYHguKrguJTguIfguJzguKXguKXguLHguJ7guJjguYwKICAgIHByaW50Zigi4LiE4LmI4Liy4LiE4Lit4Lih4Lih4Li04LiK4LiK4Lix4LmI4LiZOiAlLjJmIOC4muC4suC4l1xuIiwgY29tbWlzc2lvbik7CiAgICBwcmludGYoIuC4hOC5iOC4suC4m+C4o+C4sOC4geC4seC4meC4quC4seC4h+C4hOC4oTogJS4yZiDguJrguLLguJdcbiIsIHNvY2lhbF9zZWN1cml0eSk7CiAgICBwcmludGYoIuC4o+C4suC4ouC5hOC4lOC5ieC4o+C4p+C4oTogJS4yZiDguJrguLLguJdcbiIsIHRvdGFsX2luY29tZSk7CgogICAgcmV0dXJuIDA7Cn0=