Advertisement
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 ConsoleApplication8
- {
- class Program
- {
- static bool oszthato(int szam)
- {
- return szam % 5 == 0;
- }
- static void listaz(int[] t2)
- {
- for (int i = 0; i < t2.Length; i++)
- {
- Console.WriteLine(t2[i]);
- }
- }
- static void feltolt(int[] t)
- {
- Random r=new Random();
- for (int i = 0; i < t.Length; ++i)
- {
- t[i]=r.Next(101);
- }
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Add meg hány elemet szeretnél: ");
- int db=int.Parse(Console.ReadLine());
- int [] tomb=new int[db];
- feltolt(tomb);
- listaz(tomb);
- Console.WriteLine("A tíz 5-el oszható? " + (oszthato(10) ? "igaz" : "hamis"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement