Scissors three innings and two wins

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.