C++学习(36)

 1 //设计一个有参数操作符使用方法的例子
 2 #include<iostream.h>
 3 #include<iomanip.h>
 4 int main(){
 5     const double PI=3.141592653589793;
 6     cout<<"PI="<<setprecision(10)<<PI<<endl;
 7 
 8     int k;
 9     cin>>oct>>k;
10     cout<<"k="<<hex<<k<<endl;
11 
12     float d=324.567;
13     cout<<"d="<<setw(10)<<setprecision(5)<<setfill('*')<<dec<<d<<endl;
14 
15     return 0;
16 }

 

posted on 2018-07-01 18:31  孙悟空son_ku_kong  阅读(96)  评论(0编辑  收藏  举报

导航