usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespaceconsoleapplication1{classProgram {Static voidMain (string[] args) { intRcount =0; intDncount =0; for(inti =0; I <3; i++) {Console.Write ("please input (0 | | 1 | | 2 respectively for scissors | | Hammer | | Cloth):"); intA =int. Parse (Console.ReadLine ()); Random R=NewRandom (); intPC = R.next (3); if(A >=0&& a <3) { if(Pc-a = =-1|| Pc-a = =2) {Console.WriteLine ("computer Punch {0}, you punch {1}", PC, A +"won the");//won thercount++; } Else if(PC = =a) {Console.WriteLine ("computer Punch {0}, you punch {1}", PC, a); I= i-1; } Else{Console.WriteLine ("computer Punch {0}, you punch {1}", PC, A +"Lose the"); Dncount++; } } Else{Console.WriteLine ("Please enter the correct number! "); I= i-1; } } if(Rcount = =2) {Console.WriteLine ("three innings and two wins, congratulations, you won! "); } Else if(Dncount = =2) {Console.WriteLine ("three innings and two wins, you lose! "); } console.readline (); } }}
Scissors three innings and two wins