Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp23
- {
- #region nowa klasa
- //static class Moja_klasa
- //{
- // static public int sumka(int k)
- // {
- // int i, s = 0;
- // for (i = 1; i <= k; i++)
- // {
- // s = s + i;
- // }
- // return s;
- // }
- // static public int sumka2(int j)
- // {
- // if (j == 1)
- // {
- // return 1;
- // }
- // else
- // {
- // return sumka2(j - 1) + j;
- // }
- // }
- // static public double potega(int a, int b)
- // {
- // if (b == 1)
- // {
- // return a;
- // }
- // else
- // {
- // return potega(a, b - 1) * a;
- // }
- // }
- // static public int silnia(int n)
- // {
- // if (n==1)
- // {
- // return 1;
- // }
- // else
- // {
- // return silnia(n - 1) * n;
- // }
- // }
- //}
- #endregion
- #region ciąg fibonacciego.1
- //class Funkcje
- //{
- // public long ile = 0;
- // public long fibek (int n)
- // {
- // ile++;
- // if (( n== 1) || (n == 2))
- // {
- // return 1;
- // }
- // else
- // {
- // return fibek(n - 1) + fibek(n - 2);
- // }
- // }
- //}
- #endregion
- class Program
- {
- #region referencje
- //static int funkcja1(ref int n)
- //{
- // return ++n;
- //}
- #endregion
- #region zd.referencje
- //static void funkcja_zamien(ref int a, ref int b)
- //{
- // int tmp;
- // tmp = a;
- // a = b;
- // b = tmp;
- //}
- #endregion
- #region metody przeciążone
- //public static double pole(int r)
- //{
- // return Math.PI * Math.Pow(r, 2);
- //}
- //public static int pole(int a, int b)
- //{
- // return a*b;
- //}
- #endregion
- static void Main(string[] args)
- {
- #region nowa klasa.1
- //int n = 3;
- //Console.WriteLine("sumka = " + Moja_klasa.sumka(n));
- //Console.WriteLine("sumka2 = " + Moja_klasa.sumka2(3));
- //Console.WriteLine("potęga = " + Moja_klasa.potega(2, 10));
- //Console.WriteLine("silnia = " + Moja_klasa.silnia(8));
- //Console.ReadLine();
- #endregion
- #region ciąg fibonacciego.1
- // Funkcje fun = new Funkcje();
- // int n = 45;
- // for (int i = 1; i <= n; i++)
- //{
- // fun.ile = 0;
- // Console.WriteLine("n = "+ i + "\t fibek = " + fun.fibek(i) + "\t ile razy = " + fun.ile);
- //}
- // Console.ReadLine();
- #endregion
- #region referencje.1
- //int x = 5;
- //int y;
- //y = funkcja1(ref x);
- //Console.WriteLine(x);
- //Console.ReadLine();
- #endregion
- #region zd.referencje.1
- //int x = 2, y = 3;
- //funkcja_zamien(ref x, ref y);
- //Console.WriteLine("x = " + x);
- //Console.WriteLine("y = " + y);
- //Console.ReadLine();
- #endregion
- #region metody przeciążone.1
- //Console.WriteLine("Pole prostokąta wynosi: " + Program.pole(2, 3));
- //Console.WriteLine("Pole koła wynosi: " + Program.pole(1));
- //Console.ReadLine();
- #endregion
- }
- }
- }
Add Comment
Please, Sign In to add comment