Advertisement
Tellexxii

1.3.9.3.1

Jul 25th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Net;
  7. using System.Threading;
  8.  
  9. namespace IMJunior
  10. {
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             int a = 10, b = 15, c = 0;
  16.             SomeMul(a, b, c);
  17.  
  18.             char[] map = new char[15];
  19.             map[2] = 'T';
  20.             GenerateMap(map);
  21.  
  22.             Console.WriteLine(c);           // Выводится c
  23.             Console.WriteLine(map[2]);      // Выводится P, т.к. всем элементам массива присвоено значение 'P' в методе GenerateMap
  24.         }
  25.  
  26.         static void SomeMul(int a, int b, int c)
  27.         {
  28.             c = a * b;
  29.         }
  30.  
  31.         static void GenerateMap(char[] map)
  32.         {
  33.             for (int i = 0; i < map.Length; i++)
  34.             {
  35.                 map[i] = 'P';
  36.             }
  37.         }
  38.  
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement