用c语言编写一个商店,求助简单的C程序编写 商场购物每满100元减20元每满500再

1,求助简单的C程序编写 商场购物每满100元减20元每满500再#include<stdio.h>int main(void) int money; printf("请输入购物消费金额.\n"); scanf("%d",&money); int result=0; result=money-money/100*20-money/500*20; printf("实际付款金额为:%d",result); printf("\n"); return 0;}这么简单的程序看得懂吧,不需要我说明吧【用c语言编写一个商店,求助简单的C程序编写 商场购物每满100元减20元每满500再】
2,c编程 商店销售问题#include using namespace std; class sale { private: static double discout; static double sum; static int n; int num; int count; double price; public: sale(int n, int c, double p); static double average(); static void display(); }; sale::sale(int no, int c, double p) { num = no; count = c; price = p; n += c; sum += c >= 10 ? p * c * discout * 0.98 : p * c * discout; } double sale::average() { return sum / n; } void sale::display() { cout << "总销售款:" << sum << endl; cout << "平均售价:" << average() << endl; } double sale::discout = 0.95; double sale::sum = 0; int sale::n = 0; int main() { sale a(101, 5, 23.5), b(102, 12, 24.56), c(103, 100, 21.5); sale::display(); return 0; }

    推荐阅读