Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- // считайте два размера и определите, какой из них больше
- double part1; // первая половинка апельсина
- double part2; // вторая половинка апельсина
- double X; // разница в размере половинок апельсина
- cin >> part1 >> part2;
- if (part1 == part2) {
- cout << "The orange is divided into two equal parts" << endl;
- }
- if (part1 > part2) {
- X = part1 - part2;
- cout << "Cut off " << X << " from the first part" << endl;
- }
- if (part2 > part1) {
- X = part2 - part1;
- cout << "Cut off " << X << " from the second part" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement