Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- int main(int argc, char *argv[])
- {
- double x = stod(argv[2]);
- string parameter = argv[1];
- cout<<"Wpisales parametry: \""<<argv[1]<<"\" oraz \""
- <<argv[2]<<"\""<<endl;
- if(parameter=="sin")
- {
- x=sin(x);
- cout<<"sin("<<argv[2]<<") = "<<x<<endl;
- }
- else if(parameter=="cos")
- {
- x=cos(x);
- cout<<"cos("<<argv[2]<<") = "<<x<<endl;
- }
- else if(parameter=="cbrt")
- {
- x=cbrt(x);
- cout<<"cbrt("<<argv[2]<<") = "<<x<<endl;
- }
- else if(parameter=="exp")
- {
- x=exp(x);
- cout<<"exp("<<argv[2]<<") = "<<x<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement