Rabu, 14 September 2016

program 1.3. fungsi template parameter

#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
template<class T>
T Abc(T a,T b,T c){
    return a+b+b*c+(a+b-c)/(a+b)+4;
}

int main(int argc, char** argv) {
    cout<<Abc(2,3,4)<<endl;
    return 0;
}

Tidak ada komentar:

Posting Komentar