/* 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;
}
学习笔记习题2.3
最新推荐文章于 2024-08-02 23:00:19 发布