首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

学习札记习题2.3

2012-10-17 
学习笔记习题2.3/* programe exercise 2.3 */#includestdio.hint main(){??? ??? float price_a 3.5f

学习笔记习题2.3

/* programe exercise 2.3 */
#include<stdio.h>
int main(){
???
??? float price_a = 3.5f ;
??? float price_l = 5.5f ;
??? int shuliang = 0 ;
??? char Hhuaban = 'H' ;
??? char putongban = 'P' ;
??? char version ='0';
??? float je = 0.00f ;

??? printf(" enter the version H or P: \n");
??? scanf("%c",&version) ;
??? printf(" enter the shuliang you buy:\n");
??? scanf(" %d",&shuliang);

??? if(version == 'H'){
??? ??? je = price_l * (float) shuliang ;
??? }else{
??? ??? je = price_a * (float) shuliang ;
??? }

??? printf(" the jin e is %.2f",je);
??? return 0;

??? ?

}

热点排行