using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ConsoleApp1
{
public enum TimeOfDay
{
Morning = 0,
Afternoon = 1,
Evening = 2
}
public class MathLib
{
public int Add(int x,int y)
{
return x + y;
}
}
class ArgsExample
{
public static void Main(string[] args)
{
//int batteryCount, flowCount, backwaterCount, comeInCount, integratorCount;
//batteryCount = flowCount = backwaterCount = comeInCount = integratorCount = 4;
//int normalCount, TamperCount, BlockedCount, AbraseCount;
//normalCount = TamperCount = BlockedCount = AbraseCount = 3;
//int[] meterCalcCount = new int[] { batteryCount, flowCount, backwaterCount, comeInCount, integratorCount };
//int[] valveCalcCount = new int[] { normalCount, TamperCount, BlockedCount, AbraseCount };
//int a = meterCalcCount.Sum();
//int b = valveCalcCount.Sum();
//int a = 0x0023;//0000 0000 0010 0011
//a |= ((1 << 7) | (1 << 9));//0000 0010 1010 0011
//a &= ~((a << 7) | ((1 << 9)));
//Console.WriteLine(a);
//ConvertToBCD6("013256822831");
//控制台IO io = new 控制台IO();
//io.showText();
//io.FormatText();
//io.FormatText(0);
//运算 mv = new 运算();
//mv.MoveBit();
//mv.Calc();
//mv.XoCalc();
//Console.ReadLine();
}
public static byte[] ConvertToBCD6(string mobileNo)
{
byte[] mobileArray = new byte[6];
if (mobileNo.Length != 12)
{
return mobileArray;
}
for (int i = 0; i < 6; i++)
{
mobileArray[i] = Convert.ToByte(mobileNo.Substring(i*2,2),16);
}
return mobileArray;
}
public void oldCode()
{
//for (int i = 0; i < args.Length; i++)
//{
// Console.WriteLine(args[i]);
//}
//Class1 cl = new Class1();
//cl.show();
//MathLib mathLib = new MathLib();
//Console.WriteLine(mathLib.Add(7, 8));
}
}
class Program
{
static void Main1(string[] args)
{
string[] i = new string[] { "/a","/b","/c"};
ArgsExample.Main(i);
}
}
class Calculator
{
//public void PrintTo1(int x)
//{
// for (int i = x; i > 0; i--)
// {
// Console.Write(i);
// }
//}
public void PrintTo1(int x)
{
if (x == 1)
{
Console.WriteLine(x);
}
else
{
Console.WriteLine(x);
PrintTo1(x - 1);
}
}
public int Sum(int x)
{
int result = 0;
for (int i = 0; i < x + 1; i++)
{
result += i;
}
return result;
}
public int SumFrom1ToX(int x)
{
int result = 0;
if (x == 1)
{
return 1;
}
else
{
result = x + SumFrom1ToX(x - 1);
return result;
}
}
public int SumFrom1ToX2(int x)
{
return (1 + x) * x / 2;
/*
S =1 +2+ 3+ 4 + 5 + 6
S +1= 2+ 3+ 4 + 5 + 6 + 7
2S
*/
}
public int Add(int x, int y)
{
int result = x + y;
return result;
}
public int Add1(int x, int y)
{
int result = x + y;
return result;
}
public string Today()
{
int day = DateTime.Now.Day;
return day.ToString();
}
public void PrintSum(int a, int b)
{
int result = a + b;
Console.WriteLine(result);
}
}
#region MyRegion
/*
class Client
{
static void Main()
{
MathExample.Main();
}
}
class MathExample
{
static int Add(int x,int y)
{
return x + y;
}
public static void Main()
{
int i = Add(5,10);
Console.WriteLine(i);
Console.ReadLine();
}
} */
public class NamespaceExample
{
static void WriteGreeting(TimeOfDay timeOfDay)
{
switch (timeOfDay)
{
case TimeOfDay.Morning:
Console.WriteLine("Good morning!");
break;
case TimeOfDay.Afternoon:
Console.WriteLine("Good afternoon!");
break;
case TimeOfDay.Evening:
Console.WriteLine("Good evening!");
break;
default:
Console.WriteLine("Hello!");
break;
}
}
private static int DoSomething()
{
//Code for the class
//Console.WriteLine(TimeOfDay.Morning);
//WriteGreeting(TimeOfDay.Evening);
//TimeOfDay time = TimeOfDay.Afternoon;
//Console.WriteLine(time.ToString());
//TimeOfDay time2 = (TimeOfDay)Enum.Parse(typeof(TimeOfDay),"afternoon",true);
//Console.WriteLine((int)time2);
NamespaceExample namespaceExample = new NamespaceExample();
// do something with the nSEx variable.
Console.ReadLine();
return 0;
}
}
public struct Subscriber
{
//Code for struct here
}
#endregion
/*
会员
商品
支付
物流
仓储
营销
*/
}