結(jié)果是一樣的,似乎我數(shù)學思維上差了一點
? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int a = 3;
? ? ? ? ? ?for(int y = 1;y <= 7;y++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for(int x = 1;x <= 7;x++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (Math.Abs(x - 4) == Math.Abs(a))
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write("0");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.Write(".");
? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? a--;
? ? ? ? ? ? ? ? Console.WriteLine();
? ? ? ? ? ? }
? ? ? ? ? ? Console.ReadKey();
? ? ? ? }
? ? }
}
2019-02-07
if (Math.Abs(x - 4) == Math.Abs(a))這不段是很理解,大佬可以解說下么?
2019-01-03
額。。沒必要搞的這么復雜啦。。。。