Untitled
unknown
plain_text
a month ago
386 B
5
Indexable
#include <iostream>
#include <cmath>
#include <vector>
#include <array>
using namespace std;
template <typename T> class Min {
public:
T val1;
T val2;
Min(T v1, T v2)
{
val1 = v1;
val2 = v2;
}
T getMin()
{
if (val1 < val2)
return val1;
else
return val2;
}
};
int main()
{
Min<string> a("spl", "gfg");
cout << a.getMin();
}
Editor is loading...
Leave a Comment