1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include<iostream>
#include<iomanip>
using namespace std;
int volume(int L=1, int w=1,int h=1);
void funcone(int& x,double y=12.34,char z='b');
int main()
{
int a=23;
double b=48.78;
char ch='M';
cout<<fixed<<showpoint<<setprecision(2);
cout<<"a="<<a<<" b="<<b<<" ch="<<ch<<endl;
cout<<"volume="<<volume()<<endl;
cout<<"volume="<<volume(5,4)<<endl;
cout<<"volume="<<volume(34)<<endl;
cout<<"volume="<<volume(6,4,5)<<endl;
funcone(a);
funcone(a,42.68);
funcone(a,34.65,'Q');
cout<<"a="<<a<<" b="<<b<<" ch="<<ch<<endl;
return 0;
}
int volume(int L=1,int w=1,int h=1)
{
return L*w*h;
}
void funcone(int& x, double y,char z)
{
x=2*x;
cout<<"x="<<x<<" y="<<y<<" z="<<z<<endl;
}
|