#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
 int R = 1;
 int P = 2;
 int S = 3;
 int i;
 int Pscore = 0;
 int Cscore = 0;
 int choice;
 srand(time(NULL));
 printf("Rock=1 , Paper= 2, and Scissors= 3\n");

 while(1)
 {
  printf("Enter your choice:");
  scanf_s("%d", &choice);
  int computer = rand() % 3 + 1;
  if (choice == 1) {
   if (computer == 1) {
    printf("Draw\n");
   }
   if (computer == 2) {
    printf("Computer Wins!\n");
    Cscore = Cscore + 1;
   }
   if (computer == 3) {
    printf("Player Wins\n");
    Pscore = Pscore + 1;
   }
  }
  else  if (choice == 2) {
   if (computer == 2) {
    printf("Draw\n");
   }
   if (computer == 3) {
    printf("Player Wins!\n");
    Pscore = Pscore + 1;
   }
   if (computer == 1) {
    printf("Computer Wins!\n");
    Cscore = Cscore + 1;
   }
  }
  else if (choice == 3) {
   if (computer == 3) {
    printf("Draw\n");
   }
   if (computer == 2) {
    printf("Computer Wins!\n");
    Cscore = Cscore + 1;
   }
   if (computer == 1) {
    printf("Player Wins!\n");
    Pscore = Pscore + 1;

   }
  }
  else {
   break;
  }

 }
 if (Cscore > Pscore) {
  printf("컴퓨터 승리 %d 대 %d\n", Cscore, Pscore);
 }
 else if (Cscore < Pscore) {
  printf("플레이어 승리 %d 대 %d\n", Pscore, Cscore);
 }
 else if (Cscore = Pscore) {
  printf("최종결과 비김\n");
 }


 return 0;
}








이 코드에서

#include <stdlib.h>
#include <time.h>


 srand(time(NULL));


  int computer = rand() % 3 + 1;


얘네 간략하게 설명좀...형님들 ㅠㅠ