Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Atspejimai
- {
- class Program
- {
- static void Main(string[] args)
- {
- int kart = 10;
- int yes = 0;
- int no = 0;
- int rez1 = 0;
- Random rnd = new Random();
- Console.WriteLine("Atspek skaiciu!");
- for (int i = 1; i <=kart; i++)
- {
- int sk = rnd.Next(1, 1);
- Console.WriteLine("Tavo " + i +" spejimas");
- int input = int.Parse(Console.ReadLine());
- if (input == sk)
- {
- yes += 1;
- rez1 += 1;
- }
- else if (input != sk)
- {
- no += 1;
- rez1 = 0;
- }
- if (rez1 == 2)
- {
- kart += 1;
- rez1 = 0;
- }
- }
- Console.WriteLine("yes " + yes + " no " + no );
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement