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 Decisions
- {
- class Program
- {
- static void Main()
- {
- Console.WriteLine("Enter the secret password:");
- var password = Console.ReadLine();
- if (password.ToString() == "pie")
- {
- Echo("How many times do you want to loop?");
- }
- else
- {
- Main();
- }
- }
- private static void Echo( string Error)
- {
- Console.WriteLine(Error);
- var loopNumber = Console.ReadLine();
- int Value;
- if (int.TryParse(loopNumber, out Value))
- {
- for (int i = 0; i <= Value; i++)
- {
- Console.WriteLine("Test");
- }
- Echo("How many times do you want to loop?");
- } else
- {
- Echo("Please type in a number.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement