using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace x180821汪敏 { class Program { static void Main(string[] args) { /* Console.WriteLine("请输入您的姓名,性别和c#成绩"); String name; char sex; double score; name = Console.ReadLine(); sex = Convert.ToChar(Console.ReadLine()); score = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("姓名:"+name+"\t"+"性别:"+sex+"\t"+"c#成绩:"+score); int a = 2; a++; int j, k; j = a++; k = ++a; Console.WriteLine(j*2); Console.WriteLine(k*2); */ double pricep =25, priceb=3, pricec=10; int nump=20, numb=10, numc=5; double sump, sumb, sumc; sump = pricep * nump; sumb = priceb * numb; sumc = pricec * numc; double sum1 = sump + sumb + sumc; double sum2 = sum1 * 0.9; int k=(int)(sum2 / 100); int jf=k*3; Console.WriteLine("*************消费*************"); Console.WriteLine("品名"+"\t"+"单价"+"\t"+"数量"+"\t"+"金额"); Console.WriteLine("钢笔" + "\t" + "¥" + pricep + "\t" + nump + "\t" + sump); Console.WriteLine("笔记本" + "\t" + "¥" + priceb + "\t" + numb + "\t" + sumb); Console.WriteLine("书架" + "\t" + "¥" + pricec + "\t" + numc + "\t" + sumc); Console.WriteLine("******************************"); Console.WriteLine("金额总计"+"¥"+sum1); Console.WriteLine("折扣:9折"); Console.WriteLine("实付金额:"+sum2); Console.WriteLine("本次所获积分是:"+jf); } } }
标签:字符,Console,C#,double,System,int,拼接,WriteLine,sumb From: https://www.cnblogs.com/bky-wang/p/18124600