19 lines
245 B
C++
Executable file
19 lines
245 B
C++
Executable file
//min.cc
|
|
namespace mylib {
|
|
double min( double a, double b ) {
|
|
if ( a < b ) {
|
|
return a;
|
|
}
|
|
return b;
|
|
}
|
|
|
|
int min( int a[], int size ) {
|
|
int m = a[0];
|
|
|
|
for( int i = 1; i < size ; ++i ) {
|
|
m = min(a[i], m);
|
|
}
|
|
|
|
return m;
|
|
}
|
|
}
|