For the program to repeat itself, you should put the whole thing inside of a while loop which runs until a variable (I prefer using the word "end" as the variable name) changes to 1, like so:
Code:
int main ()
{
int end;
int everything_else;
while ( end == 0 )
{
blah blah blah
if ( a == "R" || a == "P" || a == "S" )
end = 1;
}
return 0;
}
This will have the program continually loop until the input is either R, P, or S. Oh, and its better to have the input looked for be lower case, just because nobody's going to want to hold shift and most will try the program without putting it in caps.