Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace P22_constructori
- {
- class Tablou
- {
- private int n;
- private int[] a;
- public Tablou(int dim)
- {
- n = dim;
- a = new int[n];
- Random r = new Random();
- for (int i = 0; i < n; i++)
- a[i] = r.Next(100);
- }
- public Tablou(int dim, int val)
- {
- n = dim;
- a = new int[n];
- for (int i = 0; i < n; i++)
- a[i] = val;
- }
- public Tablou(string fis)
- {
- if (!File.Exists(fis))
- {
- Console.WriteLine("Fisier inexistent");
- n = 1;
- a = new int[1];
- a[0] = 0;
- return;
- }
- StreamReader fin = new StreamReader(fis);
- n = int.Parse()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement