//OrinTill Qimid CS1A Chapter 4, P. 294, 4
//
/**************************************************************
 * Coint Flips
 * 
 * ____________________________________________________________
 * This program simulates a coin toss
 * ____________________________________________________________
 * INPUT
 * flip: amount of times the coin is fliped
 * OUTPUT
 * ran: The result
 **************************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
float num();


int main() 
{
  
num();
   
}
float num()
{
    int flip;
    int ran;
    cout<<"how manytimes do you want to flip the coin?"<<endl;
    cin>>flip;
   for (int i = 1; i <=flip ; i++)
   {
    ran = rand() % 2+1;
    if (ran==1)
    {
        cout<<"It's head"<<endl;
    }
    if (ran==2)
    {
        cout<<"It's tail"<<endl;
    }
   }
  
  
   return ran;
}