SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
46 stars 132 forks source link

Create chefWars.cpp #459

Closed YashGosaliya closed 2 years ago

YashGosaliya commented 2 years ago

Choose your form and fill it -

1. Form 1(C++ Solution contributors)

2. Form 2(C++ Documentation Contributors)


1) Form 1

Issue Id you have worked upon -

462

Briefly explain your program logic -

--> We are taking input for the number of test cases as tc. --> There are 2 inputs h (health of Darth) and p (power of Chef's attack) --> After every attack chef power is becoming half and the same value is decreased from h. --> If h decreased to zero before power is becoming zero, then Chef can kill Darth and gives output 1 --> If power becomes zero and h is non-zero integer then it gives output 0.

Screenshots(Attach 2 screenshots of your own input and output) -

Input

Screenshot (68)

Output ![Screenshot (69)](https://user-images.githubusercontent.com/58128160/137074255-41d75c0b-d8c9-499a-ba1d-2ce4ade6e98a.png)
### Checklist: Eg - If your code follow the below guidelines. Kindly change [] to [x] All the conditions should be fulfilled for considering your code for merging - - [x] I have mentioned the question as comment in my solution file.
- [x] My code follows the guidelines of this project.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code.
- [x] My code gives the correct output.
- [x] I confirm that I have not copied the code from anywhere. In case its found that I have copied even after successful merge then I can be banned from the repository and hacktoberfest.
- [x] I affirm that I strictly follow contributing guidelines and code of conduct.
# 2) Form 2 ### Issue Id you have worked upon - Kindly write your answer here
### Checklist: Eg - If your code follow the below guidelines. Kindly change [] to [x] All the conditions should be fulfilled for considering your Pull Request for merging - - [] I have performed a self-review of my documentation.
- [] I affirm that I strictly follow contributing guidelines and code of conduct.
SarthakKeshari commented 2 years ago

@YashGosaliya, Kindly mention the issue id.