Autor Wiadomość
Ricko
PostWysłany: Śro 11:17, 24 Kwi 2013    Temat postu: STUDIA: Funkcja Max

Cytat:
#include <cstdlib>
#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char *argv[])
{
double x,w1,w2;
cout<<"Program liczacy funkcje max(x+1,x^2)"<<endl;
cout<<"Podaj liczbe"<<endl<<"x=";
cin>>x;
w1=x+1;
w2=pow(x,2);
if (w1 > w2)
cout<<"f("<<x<<")="<<w1<<endl;
else
cout<<"f("<<x<<")="<<w2<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}

Powered by phpBB © 2001,2002 phpBB Group