Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Input the strength of a pirate ship" << endl;
- float a;
- cin >> a;
- cout << "Input the strength of the English ship" << endl;
- float b;
- cin >> b;
- float c;
- float d;
- do {
- cout << "Input the force attacks of pirates" << endl;
- cin >> c;
- a = a - c;
- cout << "Input the force attacks of England" << endl;
- cin >> d;
- b = b - d;
- cout << a<<endl;
- cout << b<<endl<<endl;
- } while (a > 0 && b > 0);
- if ((a <= 0) && (b>0)) {
- cout << "The England win! " << endl;
- }
- else {
- if ((a>0) && (b <= 0)) {
- cout << "Pirats win!" << endl;
- }
- else {
- cout << "DRAW"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement