Created
October 13, 2016 10:40
-
-
Save dretax/b6a219f74f7e6c7b91433b3ae6cf8bfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace iziprogzh4 | |
{ | |
internal class Program | |
{ | |
internal static int[] list = new int[100]; | |
internal static Random r; | |
internal static void Main(string[] args) | |
{ | |
r = new Random(); | |
for (int i = 0; i < list.Length; i++) | |
{ | |
int randc = r.Next(0,101); | |
//Console.WriteLine(randc); | |
list[i] = randc; | |
} | |
Calc(list); | |
bool b = Check(list); | |
if (b) | |
{ | |
Console.WriteLine("A 47-e szám benne van!"); | |
} | |
else | |
{ | |
Console.WriteLine("A 47-es nincs benne!"); | |
} | |
Console.ReadKey(); | |
} | |
internal static void Calc(int[] arg) | |
{ | |
Console.WriteLine("Elemek tízszeresei a következők: "); | |
foreach (var x in arg) | |
{ | |
Console.WriteLine( x * 10); | |
} | |
} | |
internal static bool Check(int[] arg) | |
{ | |
if (arg.Contains(47)) | |
{ | |
return true; | |
} | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment