pr0509.cpp
来自「practice c++, it is from the book http:/」· C++ 代码 · 共 20 行
CPP
20 行
// Programming with C++, Second Edition, by John R. Hubbard
// Copyright McGraw-Hill, 2000
// Problem 5.9 on page 112
// The Average of Four Function
#include <iostream> // defines the cin and cout objects
using namespace std;
double ave(double,double,double,double);
double main()
{ cout << "Enter four numbers: ";
double w, x, y, z;
cin >> w >> x >> y >> z;
cout << "Their average is " << ave(w,x,y,z) << endl;
}
double ave(double x1, double x2, double x3, double x4)
{ return (x1 + x2 + x3 + x4)/4.0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?