[ borlland @ 14.06.2008. 09:53 ] @
Interesuje me gdje sam zabrljo, negdje jesam to je ocito ... Napraviti program po formuli: Code: min(x,y), y>=0 Z= max(x*x,y+y), y<0 Upotrijebiti dvije funkcije: float min(float,float); float max(float,float); Code: #include <iostream> using namespace std; float min(float, float); float max(float,float); int main() { int x,y,z; cout << "Unesi x i y: "; cin >> x >> y ; cout << "Z= " << min(x,y) << endl; cout << "Z= " << max(x,y) << endl; system("PAUSE"); return 0; } float min(float x, float y) { if(y>=0) { if(x<y) return x; else return y; } } float max(float x, float y) { if(y<0) { if(x*x>y*y) return x*x; else return y*y; } } |