C语言
来源:互联网 发布:淘宝灯具3c认证怎么弄 编辑:程序博客网 时间:2024/06/03 04:16
//// main.c// myc//// Created by clz on 16/5/4.// Copyright © 2016年 clz. All rights reserved.//#include <stdio.h>#include <string.h>#include "Hou.h"float total = 0.0;short count = 0;short tax_percent = 6;float add_with_tax(float f){ float tax_rate = 1+tax_percent/100.0; total = total+(f*tax_rate); count = count+1; return total;}int main(int argc, const char * argv[]) { float val; printf("price of item:"); while (scanf("%f",&val)==1) { printf("Total so far:%.2f\n",add_with_tax(val)); printf("Price of item:"); } printf("\nFinal total:%.2f\n",total); printf("Number of items:%hi\n",count); return 0;}
0 0
- C语言
- C语言
- C语言
- C语言
- C语言
- c语言
- C语言
- C语言
- C语言
- C语言
- c语言
- C语言
- C语言
- C语言
- c语言
- C语言
- c语言
- c语言
- RRC Connection Reconfiguration
- 集成支付宝
- * 有一对兔子,从出生后第3个月起每个月都生一对兔子,这对小兔子长到第三个月后每个月又生一对 * 小兔子,如此循环下去。假如兔子都不死,问,两年内,每个月的兔子有多少对? * @author A
- 2016-05-08随笔
- recursive neural network梳理(CS224D lecture9)
- C语言
- HDU 4918 Query on the subtree
- Spring MVC 学习 之 - URL参数传递
- Hibernate入门(五)hibernate的级联(cascade)表操作
- CUDA学习笔记七
- JAVA语言之三色排序
- Mongodb的一些浅谈
- Android学习之界面篇(九)SurfaceView简单学习
- * 假设有n个人围成一圈,从第1个人开始报数,数到第m个人出列,然后从出列的下一个人重新开始报数,数到第m个人又出列..... * 如此反复到所有人全部出列为止。设n个人的编号分别为1,2,3..