Facebook Sharer
选择您要替换的背景颜色:
【农历新年】背景图片:
个性化设定
 注册  找回密码
查看: 2076|回复: 1
打印 上一主题 下一主题

c#的求救。。。

[复制链接]

10

主题

0

好友

1662

积分

白银长老

Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9

跳转到指定楼层
1#
发表于 2010-2-22 02:24 AM |只看该作者 |倒序浏览
#include<stdio.h>

#define price_of_rose  2.30
#define discount  0.1

const float price_of_lily = 3.90 ;

void main()
{
     int quantity_of_rose,quantity_of_lily;
     float total_price_of_rose,total_price_of_lily,total,discount_value,payment;
     
     printf("------------------------------------\n");
     printf("-          FLOWER FLORIST          -\n");
     printf("------------------------------------\n");
     printf("Enter amount of ROSE : ");
     scanf("%f",&quantity_of_rose);
     printf("Enter amount of Lily : ");
     scanf("%f",&quantity_of_lily);
     
     total_price_of_lily = quantity_of_lily * price_of_lily;
     total_price_of_rose = quantity_of_rose * price_of_rose;
     total = total_price_of_rose + total_price_of_lily;
     discount_value = total * discount;
     payment = total - discount_value;
     
         
     printf("------------------------------------\n");
     printf("-         PAYMENT RECEIPT          -\n");
     printf("------------------------------------\n");
     printf("ROSE         : $%.2f  [%.0f stalks]\n",total_price_of_rose,quantity_of_rose);
     printf("LILY         : $%.2f  [%.0f stalks]\n",total_price_of_lily,quantity_of_lily);
     printf("TOTAL        : $%.2f\n",total);
     printf("DISCOUNT     : $%.2f\n",discount_value);
     printf("------------------------------------\n");
     printf("PAYMENT      : $%.2f\n",payment);
     printf("------------------------------------\n");
         
     getche();
}



为什么跳出来的数字这样多???




收藏收藏0

10

主题

0

好友

1662

积分

白银长老

Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9

2#
发表于 2010-2-22 03:56 PM |只看该作者
解决了。。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2024-12-26 02:04 AM , Processed in 0.109338 second(s), 26 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

Ultra High-performance Dedicated Server powered by iCore Technology Sdn. Bhd.
Domain Registration | Web Hosting | Email Hosting | Forum Hosting | ECShop Hosting | Dedicated Server | Colocation Services
本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved
合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部