f03.cpp

来自「数据结构常用算法合集」· C++ 代码 · 共 16 行

CPP
16
字号
 //f03.cpp
 #include <iostream.h>				//cin,cout
 #include <conio.h>				//getch()
 float cal_mid(float,float);			//prototype
 void main()
 { float a,b,mid;
   cout << "Enter a b="; cin >> a >> b;
   mid = cal_mid(a,b);				//call function
   cout << "The data is: " << mid << endl;
   getch();
 }
 float cal_mid(float a, float b)
 {
   return  (2.0 * a * b/(a+b));
 }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?