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 ConsoleApp19
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] Guns = { "BFG", "Калаш", "Дробаш" };
- string[] Ammo = { "Лазерные плюхи", "7.62", "Дробь" };
- ReplaceArray(Guns, Ammo);
- for (int i = 0; i < Guns.Length; i++)
- {
- Console.WriteLine(Guns[i]);
- }
- }
- static string[] ExpandArray(string[] arrays, string arrayElement)
- {
- string[] tempArray = new string[arrays.Length + 1];
- for (int i = 0; i < arrays.Length; i++)
- {
- tempArray[i] = arrays[i];
- }
- tempArray[tempArray.Length - 1] = " " + arrayElement;
- arrays = tempArray;
- return arrays;
- }
- static string[] DecreaseArray(string[] arrays)
- {
- string[] tempArray = new string[arrays.Length - 1];
- for (int i = 0; i < (arrays.Length - 1); i++)
- {
- tempArray[i] = arrays[i];
- }
- arrays = tempArray;
- return arrays;
- }
- static string[] ReplaceArray(string[] arrays, string[] arrays2)
- {
- for (int i = 0; i < arrays.Length; i++)
- {
- arrays[i] = arrays2[i];
- }
- arrays = arrays2;
- return arrays;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment