consolidate all repos to one for archive
This commit is contained in:
29
semester_2/programiranje_2/primeri/Example15/main.cpp
Normal file
29
semester_2/programiranje_2/primeri/Example15/main.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <iostream>
|
||||
|
||||
template < typename T >
|
||||
T max( T a, T b ) {
|
||||
return a>b ? a : b;
|
||||
}
|
||||
|
||||
float max(float a, float b) {
|
||||
return a*b;
|
||||
}
|
||||
|
||||
int main() {
|
||||
double x, y, res;
|
||||
x=1;
|
||||
y=1;
|
||||
res = max(x-1,y+2.5);
|
||||
std::cout << res << std::endl;
|
||||
|
||||
int i = 1;
|
||||
int k = max(i, 3);
|
||||
std::cout << k << std::endl;
|
||||
|
||||
float a = 1.1, b=2.2;
|
||||
float c = max(a,b);
|
||||
std::cout << c << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user