Ответ:
N будет вводиться с клавы
using System;
using System.Collections.Generic;
using System.Numerics;
namespace ConsoleApp2
{
class Program
static void Main(string[] args)
int N = Convert.ToInt32(Console.ReadLine());
List<Vector3> Vectors = new List<Vector3>();
Random Rnd = new Random();
for (int i = 0; i < N; i++)
Vector3 TempVector = new Vector3();
TempVector.X = (float)(Rnd.NextDouble() * 20.0 - 10.0);
TempVector.Y = (float)(Rnd.NextDouble() * 20.0 - 10.0);
TempVector.Z = (float)(Rnd.NextDouble() * 20.0 - 10.0);
Vectors.Add(TempVector);
Console.WriteLine(TempVector.ToString());
}
Console.ReadLine();
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
N будет вводиться с клавы
using System;
using System.Collections.Generic;
using System.Numerics;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
int N = Convert.ToInt32(Console.ReadLine());
List<Vector3> Vectors = new List<Vector3>();
Random Rnd = new Random();
for (int i = 0; i < N; i++)
{
Vector3 TempVector = new Vector3();
TempVector.X = (float)(Rnd.NextDouble() * 20.0 - 10.0);
TempVector.Y = (float)(Rnd.NextDouble() * 20.0 - 10.0);
TempVector.Z = (float)(Rnd.NextDouble() * 20.0 - 10.0);
Vectors.Add(TempVector);
Console.WriteLine(TempVector.ToString());
}
Console.ReadLine();
}
}
}