Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include <conio.h>
- #include <stdio.h>
- #include <math.h>
- #pragma hdrstop
- //---------------------------------------------------------------------------
- #pragma argsused
- int main(int argc, char* argv[])
- {
- double x,y,z,u,ma;
- int kod;
- puts("Input x, y, z");
- scanf("%lf%lf%lf",&x, &y, &z);
- puts("Function U(x):\n 0 - cos(x)\n 1 - sin(x)\n 2 - tan(x)");
- scanf("%d", &kod);
- switch(kod){
- case 0:
- u=cos(x);
- printf("\n\tCos(x)= %8.6lf",u);
- break;
- case 1:
- u=sin(x);
- printf("\n\Sin(x)= %8.6lf",u);
- break;
- case 2:
- u=tan(x);
- printf("\n\Tg(x)= %8.6lf",u);
- break;
- }
- puts("\nMax ABS - 1, Else - Max");
- scanf("%d", &kod);
- if (kod == 1){
- u = fabs(u);
- y = fabs(y);
- z = fabs(z);
- }
- if (u>y) ma=u;
- else ma=y;
- if (z>ma) ma=z;
- if (kod==1)printf("Max ABS = %8.6lf", ma);
- else printf("Max = %8.6lf", ma);
- puts("\nPress any key ... ");
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement