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;
- namespace _21_1_String_1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int End = 0, Know = 0, i = 0;
- string[] Chosen = { "anny", "banny", "canny", "danny", "eanny" };
- Console.WriteLine("Type the contestant name");
- string Contestant = Console.ReadLine().ToLower();
- while (End != 1)
- {
- if (i != Chosen.Length + 1)
- {
- if (Chosen[i] == Contestant)
- {
- Know = i + 1;
- Console.WriteLine("{0} Won, he knew this after {1} player names were read", Contestant, Know);
- End = 1;
- }
- else if (Contestant.CompareTo(Chosen[i]) == -1)
- {
- Know = i + 1;
- Console.WriteLine("{0} Lost, he knew this after {1} player names were read", Contestant, Know);
- End = 1;
- }
- else if (i == Chosen.Length-1)
- {
- Console.WriteLine("{0} Lost, he knew this after {1} player names were read", Contestant, Chosen.Length);
- break;
- }
- else
- {
- ++i;
- }
- }
- }
- }
- }
- }
- /*
- * בסיום בחינת הקבלה למקהלת הזמר העירונית יוצא הבוחן הראשי וקורא את שמות המועמדים עפ סדר האלף בת
- * מי ששומע את שמו יודע שהתקבל, ומועמד ששמו לא נקרא ושמע שם אחר המופיע בסדר האב יודע כי לא התקבל ללהקה
- * קלוט את שם המועמד ורשימת שמות שבחר הבוחן
- * פלוט אם המועמד התקבל ומספר הרשימה שהיה עליו לשמוע לפני שהגיע למסקנה אם התקבל או לא
- */
Advertisement
Add Comment
Please, Sign In to add comment