a_11_1.cpp

来自「C++应用教程原码,里面包含该书中有十三章内容的代码,详细具体」· C++ 代码 · 共 17 行

CPP
17
字号
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
template <class Type>
Type multiplication(Type x, Type y) { 
     return x*y;
}
void main() {
int x = 8, y = 23;
double a = 2.342, b = 33.187;
cout << x <<" * "<<y << " = " << multiplication(x,y);
cout << endl;
cout << a <<" * "<<b << " = " << multiplication(a,b);
cin.get();//等待结束,以便调测程序,可以删除
}

⌨️ 快捷键说明

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