Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- using System;
- public class CrazyTables
- {
- public static void Main(string[] args)
- {
- if(args.Length != 1)
- {
- Console.WriteLine("Use it like this: ");
- Console.WriteLine(" CrayTables.exe <float>");
- Console.WriteLine("\n<float>: The number to use when generating the times table.");
- return;
- }
- float number = float.Parse(args[0].Trim());
- if(number == 0 || number == 1)
- {
- Console.WriteLine("Invalid times table number.");
- return;
- }
- for(int i = 0; i < 12; i++)
- {
- Console.WriteLine("{0,2} times {1} is {2,2}", i + 1, number, (i + 1) * number);
- }
- }
- public static bool ValidateInput(float number)
- {
- if (number == 0 || number == 1)
- return false;
- else
- return true;
- }
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.