Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <windows.h>
- int main()
- {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- float x, y, newx, newy;
- printf("Введите X\n");
- scanf("%f",&x);
- printf("Введите Y\n");
- scanf("%f",&y);
- if(x > 0 && y > 0) {
- newx = sqrtf(x);
- newy = sqrtf(y);
- } else if(x > 0 || y > 0) {
- newx = pow(x, 2);
- newy = pow(y, 2);
- } else {
- newx = fabsf(x);
- newy = fabsf(y);
- }
- printf("Результат:\n");
- printf("X: %f\nY: %f", newx, newy);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement