Untitled
unknown
plain_text
2 years ago
499 B
6
Indexable
#include <iostream> #include <string> #include <vector> using namespace std; int minimal(int a,int b,int c,int d) { int r = a; if (r > b) r = b; if (r > c) r = c; if (r > d) r = d; return r; } int maximal(int a, int b, int c, int d) { int r = a; if (r < b) r = b; if (r < c) r = c; if (r < d) r = d; return r; } int main() { int g, s,f,e; cin >> g >> s >> f >> e; cout << "min = " << minimal(g, s, f, e)<< "\t"; cout << "max = " << maximal(g, s, f, e)<< "\t"; }
Editor is loading...