编制内联函数求解2X平方+4X加5的值,x为整数,并用主函数调用该函数
#include <iostream> using namespace std; inline int cal(int x) { return 2*x*x+4*x+5; } int main() { int t = cal(5); cout << t; return 0; }