Advertisement
barybatle

zadanie 3 lancuchy

Nov 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace zad3lancuchy
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Random rnd = new Random();
  14.  
  15.             Console.WriteLine("Podaj liczbę elementów tablicy: ");
  16.  
  17.             int ile = int.Parse(Console.ReadLine());
  18.  
  19.             double[] tab1 = new double[ile];
  20.  
  21.             for (int i = 0; i < tab1.Length; i++)
  22.             {
  23.                 tab1[i] = rnd.Next(100, 201) / 10.00;
  24.             }
  25.             string s1 = string.Join("|", tab1);
  26.  
  27.             string s2 = s1.Replace(',', '.');
  28.  
  29.             Console.WriteLine(s2);
  30.  
  31.             Console.ReadKey();
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement