Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp14
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- #region zadanie 00
- //Console.WriteLine("Podaj swoje imię");
- //string imie = Console.ReadLine();
- //Console.WriteLine("Witaj " + imie);
- //Console.ReadKey();
- #endregion
- #region zadanie 0
- //int liczba;
- //Console.WriteLine("Podaj liczbę");
- //liczba = int.Parse(Console.ReadLine());
- //if (liczba < 0)
- //{
- // Console.WriteLine(-liczba);
- //}
- //else
- //{
- // Console.WriteLine(liczba);
- //}
- //Console.ReadLine();
- #endregion
- #region zadanie 7
- //int a, b, c;
- //Console.WriteLine("Podaj a");
- //a = Convert.ToInt32(Console.ReadLine());
- //Console.WriteLine("Podaj b");
- //b = Convert.ToInt32(Console.ReadLine());
- //Console.WriteLine("Podaj c");
- //c = Convert.ToInt32(Console.ReadLine());
- //if (a > b)
- //{
- // if (a > c)
- // {
- // Console.WriteLine(a);
- // }
- // else
- // {
- // Console.WriteLine(c);
- // }
- //}
- //else
- //{
- // if (b > c)
- // {
- // Console.WriteLine(b);
- // }
- // else
- // {
- // Console.WriteLine(c);
- // }
- //}
- //Console.ReadKey();
- #endregion
- #region zadanie 2
- //int liczba;
- //Console.WriteLine("Podaj liczbę");
- //liczba = Convert.ToInt32(Console.ReadLine());
- //for (int i = 1; i <= liczba; i++)
- //{
- // if (liczba % i == 0)
- // {
- // Console.WriteLine(i);
- // }
- //}
- //Console.ReadLine();
- #endregion
- #region zadanie 4
- //int a, b;
- //int w;
- //int j = 0;
- //Console.WriteLine("Podaj a");
- //a = Convert.ToInt32(Console.ReadLine());
- //w = a;
- //Console.WriteLine("Podaj b");
- //b = Convert.ToInt32(Console.ReadLine());
- //for (j = 1; j < b; j++)
- //{
- // w *= a;
- //}
- //Console.WriteLine(w);
- //Console.ReadLine();
- #endregion
- #region zadanie 1
- //int n;
- //int s = 0;
- //Console.WriteLine("Podaj liczbę n");
- //n = Convert.ToInt32(Console.ReadLine());
- //for (int j = 0; j <= n; j++)
- //{
- // s += j;
- //}
- //Console.WriteLine("Suma od 1 do " + n + " = " + s);
- //Console.ReadLine();
- #endregion
- #region zadanie 5
- //int liczba;
- //int suma = 0;
- //int i = 0;
- //Console.WriteLine("Podaj liczbę");
- //liczba = Convert.ToInt32(Console.ReadLine());
- //while (suma <= liczba)
- //{
- // i++;
- // suma = suma + i;
- //}
- //Console.WriteLine(i);
- //Console.ReadLine();
- #endregion
- #region zadanie 8
- //int a, b;
- //int i = 0;
- //Console.WriteLine("Podaj a");
- //a = Convert.ToInt32(Console.ReadLine());
- //Console.WriteLine("Podaj b");
- //b = Convert.ToInt32(Console.ReadLine());
- //while (b <= a)
- //{
- // a = a - b;
- // i++;
- //}
- //Console.WriteLine(i);
- //Console.ReadLine();
- #endregion
- #region zadanie 3
- //double a, suma = 0;
- //int i = 0, ile = 0;
- //while (i < 10)
- //{
- // Console.WriteLine("Podaj liczbę");
- // a = Convert.ToInt32(Console.ReadLine());
- // i++;
- // if (a > 0)
- // {
- // suma = suma + a;
- // ile = ile + 1;
- // }
- //}
- //Console.WriteLine("Średnia: " + Math.Round(suma/ile, 2));
- //Console.ReadLine();
- #endregion
- double moje_pi = 0;
- for (int i = 0; i <= 10000; i++)
- {
- moje_pi += Math.Pow(-1, i) / (2 * i + 1);
- }
- Console.WriteLine(moje_pi * 4);
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment