Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication8
  8. {
  9. class Program
  10. {
  11.  
  12. static bool oszthato(int szam)
  13. {
  14. return szam % 5 == 0;
  15.  
  16. }
  17.  
  18.  
  19. static void listaz(int[] t2)
  20. {
  21. for (int i = 0; i < t2.Length; i++)
  22. {
  23. Console.WriteLine(t2[i]);
  24. }
  25.  
  26. }
  27. static void feltolt(int[] t)
  28. {
  29. Random r=new Random();
  30. for (int i = 0; i < t.Length; ++i)
  31. {
  32. t[i]=r.Next(101);
  33.  
  34. }
  35. }
  36. static void Main(string[] args)
  37. {
  38.  
  39.  
  40. Console.WriteLine("Add meg hány elemet szeretnél: ");
  41. int db=int.Parse(Console.ReadLine());
  42. int [] tomb=new int[db];
  43.  
  44. feltolt(tomb);
  45. listaz(tomb);
  46.  
  47.  
  48. Console.WriteLine("A tíz 5-el oszható? " + (oszthato(10) ? "igaz" : "hamis"));
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement