Guest User

Untitled

a guest
Mar 17th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 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 ConsoleApp2
  8. {
  9. class Program
  10. {
  11.  
  12. static void Main(string[] args)
  13. {
  14. //Parasyti funkcija kuri apskaciuos skaiciaus faktoriala:
  15. //Pavyzdziui 5 skaiciaus faktorialas 5 * 4 * 3 * 2 * 1 = 120
  16. //Vartotojaus prasome ivesti naturalu skaiciu,
  17. //Jei pavyzdziui jis iveda neigama arba 0, tai paprasome ji ivesti is naujo, tol kol neivede teigiamo skaiciaus,
  18. //Su f - ja apskaiciuojame to skaiciaus faktoriala ir isvedame i ekrana.
  19. Random random = new Random();
  20. int number, count;
  21.  
  22. for (int i = 0; i < 1; i++)
  23. {
  24. for (int j = 0; j < 1; j++)
  25. {
  26. for (int k = 0; k < 10; k++)
  27. {
  28. for (int l = 0; l < 1; l++)
  29. {
  30. for (int p = 0; p < 1; p++)
  31. number = random.Next();
  32. Console.WriteLine("Prasome ivesti skaiciu {0}*{1}*{2}*{3}*{4}={5}", i, j, k, l, i * j * k * l * p);
  33. }
  34. Console.ReadKey();
  35.  
  36. }
  37. }
  38. }
  39.  
  40. }
  41. }
  42. }
Add Comment
Please, Sign In to add comment