Facebook
From Idiotic Panda, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 182
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Lab1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double d;
  14.             float f;
  15.             int i;
  16.             decimal m;
  17.  
  18.             decimal w = 0;
  19.             decimal x = 2;
  20.  
  21.             decimal p = 100;
  22.             p = (x + p) / 2;
  23.             w = x / p;
  24.             for (int s = 0; s < 7; s++)
  25.             {
  26.                 p = (w + p) / 2;
  27.                 w = x / p;
  28.             }
  29.             Console.WriteLine(w);
  30.             Console.ReadLine();
  31.  
  32.  
  33.             /*
  34.             double x = 100;
  35.             double y = Math.Sqrt(x);
  36.             Console.WriteLine(y);
  37.             Console.ReadLine();
  38.             */
  39.  
  40.             /*
  41.             checked
  42.             Console.WriteLine("Z jakiej liczby policzyc silnie? ");
  43.             string x = Console.ReadLine();
  44.             int a = Convert.ToInt32(x);
  45.           //  Console.WriteLine(a);
  46.             int wynik=1;
  47.             for (int y = 1; y <= a; y++)
  48.             {
  49.                 wynik =wynik*y;
  50.                 if (y==a)
  51.                 Console.WriteLine(wynik);
  52.             }
  53.            unchecked
  54.             Console.ReadLine();
  55.             */
  56.  
  57.             /*
  58.             for (decimal f1 = -1; f1 < 1; f1 += 0.1m)
  59.             {
  60.                 Console.WriteLine(f1);
  61.                 if (f1 == 0)
  62.                     Console.WriteLine("zero");
  63.             }
  64.             Console.ReadLine();
  65.             */
  66.  
  67.             /*
  68.             for (float f1 = -1; f1 < 1; f1+=0.1f)
  69.             {
  70.                 Console.WriteLine(f1);
  71.                 if (f1 > 0)
  72.                     Console.WriteLine("zero");
  73.             }
  74.             Console.ReadLine();*/
  75.  
  76.             /*double x = 10000000.17;
  77.             Console.WriteLine(x);
  78.             Console.ReadLine();*/
  79.  
  80.             /*double suma = 0;
  81.             for (int i = 0; i < args.Length; i++)
  82.             {
  83.                 Console.WriteLine(args[i]);
  84.                 suma += Convert.ToDouble(args[i]);
  85.             }
  86.             Console.WriteLine("suma" + suma);
  87.             Console.ReadLine();*/
  88.  
  89.  
  90.             /*
  91.             Console.Write("a=");
  92.             string sa = Console.ReadLine();
  93.             double a = Convert.ToDouble(sa);
  94.             Console.Write("b=");
  95.             string ba = Console.ReadLine();
  96.             double b = Convert.ToDouble(ba);
  97.  
  98.             double c = a + b;
  99.             string sc = c.ToString();
  100.  
  101.             Console.WriteLine("c= " + sc);
  102.             Console.ReadLine();*/
  103.  
  104.         }
  105.     }
  106. }
  107.