Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string correct;
- string file = "szotar.txt";
- int hossz;
- StreamReader sr = new StreamReader(file);
- Console.Write("Egy helyes szót kérek: ");
- string word = Console.ReadLine();
- correct = sr.ReadLine();
- while (correct != null)
- {
- if (correct == word)
- {
- Console.WriteLine("A szó helyes!");
- break;
- }
- else
- {
- correct = sr.ReadLine();
- }
- }
- if (correct == null)
- {
- Console.WriteLine("A szó helytelen!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement