Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- class Program
- {
- static void Main(string[] args)
- {
- int kertoma = 1;
- Console.WriteLine("Anna positiivinen meme XD :");
- int Kluku = int.Parse(Console.ReadLine());
- for (int i = 1; i <= Kluku; i++)
- {
- kertoma *= i;
- }
- Console.WriteLine("Luvun kertoma on " + kertoma);
- Console.ReadLine();
- }
- }
- ----------------------------------------
- namespace Kustannuskeskimemelaskuri
- {
- class Program
- {
- static void Main(string[] args)
- {
- int kustannukset;
- float kissa = 0;
- float apuluku;
- Console.WriteLine("Kuinka monta memeä syötetään? XDD");
- kustannukset = int.Parse(Console.ReadLine());
- for (int i = 0; i < kustannukset; i++)
- {
- Console.WriteLine("Anna " + (i+1) + " kustannus");
- apuluku = int.Parse(Console.ReadLine());
- kissa += apuluku;
- }
- Console.WriteLine(" Keskimemearvo on " + kissa / kustannukset);
- Console.ReadLine();
- }
- }
- }
- -----------------------------------------
- namespace Fibonakki
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a = 0;
- int b = 1;
- int c = 0;
- Console.WriteLine("Anna vuoden numero:");
- int vuosi = int.Parse(Console.ReadLine());
- if (vuosi == 1)
- {
- Console.WriteLine("Liikevaihdon kerroin kyseisenä memevuotena oli 1.");
- }
- else
- {
- vuosi += 1;
- for (int i = 2; i < vuosi; i++)
- {
- c = a + b;
- a = b;
- b = c;
- }
- Console.WriteLine("Liikevaihdon memekerroin on " + c);
- Console.ReadKey();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement