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 ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Parasyti funkcija kuri apskaciuos skaiciaus faktoriala:
- //Pavyzdziui 5 skaiciaus faktorialas 5 * 4 * 3 * 2 * 1 = 120
- //Vartotojaus prasome ivesti naturalu skaiciu,
- //Jei pavyzdziui jis iveda neigama arba 0, tai paprasome ji ivesti is naujo, tol kol neivede teigiamo skaiciaus,
- //Su f - ja apskaiciuojame to skaiciaus faktoriala ir isvedame i ekrana.
- Random random = new Random();
- int number, count;
- for (int i = 0; i < 1; i++)
- {
- for (int j = 0; j < 1; j++)
- {
- for (int k = 0; k < 10; k++)
- {
- for (int l = 0; l < 1; l++)
- {
- for (int p = 0; p < 1; p++)
- number = random.Next();
- Console.WriteLine("Prasome ivesti skaiciu {0}*{1}*{2}*{3}*{4}={5}", i, j, k, l, i * j * k * l * p);
- }
- Console.ReadKey();
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment