[已解决] 10 个数字的序列 - 在 C# 中,每个数字乘以它自己

  

2
主题启动器

I need to write a Console Application in C# of a sequence of 10 numbers - from 0 to 9 - and on each line to print - the number multiplied by itself.

A bit foggy explanation, but the output must look like this:

C# numbers multiply

1 答案
2

Try to use this code:

using System;
 
class MultiplyNumbers
{
    static void Main()
    {
        for (int i = 0; i < 10; i++)
        {
            Console.WriteLine(i + " --> " + i * i);
        }
    }
}
分享: