From 8a511e6b59a5d7a6c0f9881f06e3563b97e53a4f Mon Sep 17 00:00:00 2001 From: chbjwebfjwebfjwhb <117753284+chbjwebfjwebfjwhb@users.noreply.github.com> Date: Wed, 8 Feb 2023 09:59:53 +0700 Subject: [PATCH] Add files via upload --- 4.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 4.cpp diff --git a/4.cpp b/4.cpp new file mode 100644 index 0000000..d948aa6 --- /dev/null +++ b/4.cpp @@ -0,0 +1,21 @@ +#include +using namespace std; +int main(int argc, char *argv[]) +{ + int a = atoi(argv[1]); + char b = argv[2][0]; + switch (b) + { + case 's': + { + cout << sqrt(a); + break; + } + case 'c': + { + cout << cos(a); + break; + } + } + return 0; +}