Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- #include <cmath>
- int main()
- {
- int S, P;
- int X, Y;
- std::cout << "Iveskite plota: ";
- std::cin >> S;
- std::cout << "Iveskite perimetra: ";
- std::cin >> P;
- Y = abs(0.25 * (sqrt(P*P - 16*S) + P));
- X = abs(Y - P/2);
- std::cout << "Plotui " << S << " ir perimetrui " << P << " naudotas staciakampis kurio dimensijos: " << X << "x" << Y << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement