编程题优惠券
1. C语言编程题目
2. C语言编程,题目:周末商场促销,某品牌服装即可以买套装,又可以买单件,若买的不少于50套,每套80
#include<stdio.h>
int Get(int count)
{
if(count>=50)
return count*80;
else
return count*90;
}
int Pay(int shangyi,int kuzi)
{
int gold=0;
int left=0;
if(shangyi==kuzi)
gold=Get(shangyi);
else if(shangyi>kuzi)
{
gold=Get(kuzi);
left=shangyi-kuzi;
gold+=left*60;
}
else if(shangyi<kuzi)
{
gold=Get(shangyi);
left=kuzi-shangyi;
gold+=left*45;
}
return gold;
}
int main()
{
int shangyi=55;
int kuzi=50;
int gold=Pay(shangyi,kuzi);
printf("%d ",gold);
system("pause");
}
3. C语言编程应用题
#include<stdio.h>
intmain()
{doublex,y;
charc;
printf("请选择普通顾客/会员顾客(P/H):");
scanf("%c",&c);
printf("请输入商品总额:");
scanf("%lf",&x);
if(c=='H'||c=='h')
if(x>=1000)y=0.7*x;
elsey=0.8*x;
else
if(x>100)y=0.9*x;
elsey=x;
printf("应收费:%.2lf
",y);
return0;
}
4. 请问这道c++编程题怎么做(急求大神帮忙)——抽奖2
按照题目要求编写的抽奖的C++程序如下(见图)