ch19_4.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:0k
源码类别:
C#编程
开发平台:
Visual C++
- //**********************
- //** ch19_4.cpp **
- //**********************
- #include<iostream.h>
- void fn(float interest, float amount)
- {
- cout <<"RMB amount = ";
- cout.precision(2); //置有效位数为2位
- cout <<amount;
- cout <<"nthe interest = ";
- cout.precision(4); //置有效位数为4位
- cout <<interest <<endl;
- }
- void main()
- {
- float f1 =29.41560067;
- float f2 =12.567188;
- fn(f1,f2);
- }