Code:

#include <iostream>
#include <string>
#include <math.h>
using namespace std;
template<class T> T inner_product(const T &a, const T &b){
return a * a + b * b;
}
template<class T> T squareroot(const T &c){
return sqrt(c);
}
template<class T> T pythagorean(const T &a, const T &b){
return squareroot(inner_product(a, b));
}
int main(){
int a = 2, b = 4;
double c = 10, d = 3;
string string1 = "This is a test.";
string string2 = "This is another test with more characters.";
cout << pythagorean(a, b)
<< endl << pythagorean(c, d)
<< endl << pythagorean(string1.size(), string2.size());
return 0;
}