Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. {
  2. class Program
  3. {
  4. static void Main(string[] args)
  5. {
  6. int kertoma = 1;
  7.  
  8. Console.WriteLine("Anna positiivinen meme XD :");
  9. int Kluku = int.Parse(Console.ReadLine());
  10.  
  11. for (int i = 1; i <= Kluku; i++)
  12. {
  13. kertoma *= i;
  14. }
  15. Console.WriteLine("Luvun kertoma on " + kertoma);
  16. Console.ReadLine();
  17. }
  18. }
  19.  
  20. ----------------------------------------
  21. namespace Kustannuskeskimemelaskuri
  22. {
  23. class Program
  24. {
  25. static void Main(string[] args)
  26. {
  27. int kustannukset;
  28. float kissa = 0;
  29. float apuluku;
  30.  
  31. Console.WriteLine("Kuinka monta memeä syötetään? XDD");
  32. kustannukset = int.Parse(Console.ReadLine());
  33.  
  34. for (int i = 0; i < kustannukset; i++)
  35. {
  36. Console.WriteLine("Anna " + (i+1) + " kustannus");
  37. apuluku = int.Parse(Console.ReadLine());
  38. kissa += apuluku;
  39.  
  40. }
  41. Console.WriteLine(" Keskimemearvo on " + kissa / kustannukset);
  42. Console.ReadLine();
  43.  
  44.  
  45. }
  46. }
  47. }
  48. -----------------------------------------
  49. namespace Fibonakki
  50. {
  51. class Program
  52. {
  53. static void Main(string[] args)
  54. {
  55. int a = 0;
  56. int b = 1;
  57. int c = 0;
  58.  
  59.  
  60.  
  61. Console.WriteLine("Anna vuoden numero:");
  62. int vuosi = int.Parse(Console.ReadLine());
  63. if (vuosi == 1)
  64. {
  65. Console.WriteLine("Liikevaihdon kerroin kyseisenä memevuotena oli 1.");
  66. }
  67. else
  68. {
  69.  
  70.  
  71. vuosi += 1;
  72. for (int i = 2; i < vuosi; i++)
  73. {
  74.  
  75. c = a + b;
  76. a = b;
  77. b = c;
  78.  
  79.  
  80. }
  81. Console.WriteLine("Liikevaihdon memekerroin on " + c);
  82. Console.ReadKey();
  83. }
  84. }
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement