Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Czapla
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n;
- double xStart, xKoniec, deltaX;
- List<double> w = new List<double>();
- Console.Write("n = ");
- n = int.Parse(Console.ReadLine());
- Console.Write("x start = ");
- xStart = double.Parse(Console.ReadLine());
- Console.Write("x koniec = ");
- xKoniec = double.Parse(Console.ReadLine());
- deltaX = (xKoniec - xStart) / (n - 1);
- for (int i = 0; i < n ; i++)
- {
- w.Add(xStart + (deltaX * i)) ;
- }
- Console.WriteLine();
- Console.Write("<W> = [ ");
- foreach (var x in w)
- {
- Console.Write(x);
- Console.Write(" ");
- }
- Console.Write(" ]");
- double[,] macierz = new double[n,n];
- for(int i = 0; i < n; i++)
- {
- for(int j = 0; j < n; j++)
- {
- macierz[i, j] = (i + 1) * w[j];
- }
- }
- Console.WriteLine();
- Console.WriteLine("Wyswietl macierz");
- Console.Write("[W] = ");
- for (int i = 0; i < n; i++)
- {
- Console.Write("[ ");
- for (int j = 0; j < n; j++)
- {
- Console.Write(macierz[i, j]);
- Console.Write(" ");
- }
- Console.Write(" ]");
- Console.WriteLine();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement