Computer Science, asked by lakshmisundarnair, 5 months ago

Though there have been more successful pirates, Blackbeard is one of the best-known and widely-feared of his time. He commanded four ships and had a pirate army of 300 at the height of his career and defeated the famous warship, HMS “Scarborough” in sea-battle. He was known for barreling into battle clutching two swords with several knives and pistols at the ready. He captured over forty merchant ships in the Caribbean and without flinching killed many prisoners. Now, Blackbeard and his three pirates found a treasure of gold coins. Long Ben too joined them. They decided to share the treasure. Blackbeard agreed to give x% share for Long Ben. He then decided to take y% share from the remaining treasure. His other pirates will share the remaining gold coins equally. Write a program to compute their share's.

Answers

Answered by bharathrajpragada
4

Answer:

#include<iostream>

using namespace std;

int main()

{

 int n,x,y;

 cin>>n>>x>>y;

 int lb,bb,tp;

 lb=(x/100)*(n);

 bb=(y/100)*(n-lb);

 tp=(n-(lb+bb))/3;

 cout<<lb<<"\n";

 cout<<bb<<"\n";

 cout<<tp<<"\n";

 }

Explanation:

Answered by golusolu
0

The program for the computation of shares is given below.

Explanation:

Program for computation of shares -

#include<iostream>

using namespace std;

int main()

{

int n,x,y;

cin>>n>>x>>y;

int lb,bb,tp;

lb=(x/100)*(n);

bb=(y/100)*(n-lb);

tp=(n-(lb+bb))/3;

cout<<lb<<"\n";

cout<<bb<<"\n";

cout<<tp<<"\n";

}

Hence, shown.

#SPJ2

Similar questions