You really shouldn't use the C library random functions srand() and rand(). The C standard recommends not using them.
C++ has a wide variety of class templates for creating random numbers in the <random> header, that have none of the deficiencies of rand():
http://www.cplusplus.com/reference/random/
(lots of examples how to use)
Using a switch statement is less error prone over using multiple if/else if statements.
#include <iostream>
#include <chrono> // for seeding the random number engine
#include <random> // for random number engine and distribution
#include <string>
int main()
{
// char play;
// std::string person;
std::string computer;
// obtain a seed from the system clock:
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
// create a random generator, seeding it
std::mt19937 rng(seed); // mt19937 is a standard mersenne_twister_engine
// create a uniform int distribution, between 1 and 3
std::uniform_int_distribution<int> dist(1, 3);
for (size_t loop = 0; loop < 10; loop++)
{
// generate a random number, using the engine and distribution
int i = dist(rng);
switch (i)
{
case 1:
computer = "paper";
break;
case 2:
computer = "rock";
break;
case 3:
computer = "scissors";
}
std::cout << computer << std::endl;
}
}
rock
rock
paper
scissors
scissors
scissors
paper
rock
paper
paper