Skip to content
Permalink
ac14ca3c3f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
20 lines (16 sloc) 535 Bytes
#include <iostream>
using namespace std;
string hit = "hit"; //string hit to allow user to initiate the sequence.
int i = 3; // integer to measure health.
string health = "Health: "; //health string to print out how much health the user has.
int main()
{
cout << health << i << endl;
while ( i > 0); //loop so while i is greater than 0 the fight simulation will run until i is less than 0.
{
if ( cin >> hit);
{
cout << health << i-1;
}
}
}