Professional Documents
Culture Documents
2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
double x = double.Parse(Console.ReadLine());// dobijamo vrednosti
svih tacaka prvo
double y = double.Parse(Console.ReadLine());
double x1 = double.Parse(Console.ReadLine());
double y1 = double.Parse(Console.ReadLine());
double x2 = double.Parse(Console.ReadLine());
double y2 = double.Parse(Console.ReadLine());
double xs = Math.Abs(x - x1); // pravimo pravougli trougao i
izracunavamo x stranicu
double ys = Math.Abs(y - y1); // pravimo pravougli trougao i
izracunavamo y stranicu
double s = Math.Sqrt((xs * xs) + (ys * ys)); // pomocu pitagore
izracunavamo s stranicu ili stranicu a
double xs1 = Math.Abs(x1 - x2); // isto kao pre samo druge tacke
double ys1 = Math.Abs(y1 - y2);
double s1 = Math.Sqrt((xs1 * xs1) + (ys1 * ys1));
double xs2 = Math.Abs(x2 - x);
double ys2 = Math.Abs(y2 - y);
double s2 = Math.Sqrt((xs2 * xs2) + (ys2 * ys2));
double obim = s + s1 + s2; // a + b + c je obim trougla
Console.WriteLine("Obim je: {0}", obim);
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
double fi = 0.0000000000667; // vrednost fi-a
double m1 = double.Parse(Console.ReadLine()); // uzimamo podatke
double m2 = double.Parse(Console.ReadLine());
double r = double.Parse(Console.ReadLine());
double F = fi * ((m1 * m2) / (r * r)); // formula
Console.WriteLine("Sila je: {0}", F);
Console.ReadKey();
}
}
}
a)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
double x = double.Parse(Console.ReadLine());// dobijamo vrednosti x
y
double y = double.Parse(Console.ReadLine());
if (x>=y)
{
double min = y;
double max = x;
double jednacina = (min + 0.5)/(1 + Math.Abs(min));
Console.WriteLine("Resenje je: {0}", jednacina);
Console.ReadLine();
}
else
{
double min = x;
double max = y;
double jednacina = (min + 0.5)/(1 + Math.Abs(min));
Console.WriteLine("Resenje je: {0}", jednacina);
Console.ReadLine();
}
}
}
}
b)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
double x = double.Parse(Console.ReadLine());// dobijamo vrednosti x
y
double y = double.Parse(Console.ReadLine());
if (x>=y)
{
double min = y;
double max = x;
double jednacina = (min + 0.5)/(1 + Math.Abs(max));
Console.WriteLine("Resenje je: {0}", jednacina);
Console.ReadLine();
}
else
{
double min = x;
double max = y;
double jednacina = (min + 0.5)/(1 + Math.Abs(max));
Console.WriteLine("Resenje je: {0}", jednacina);
Console.ReadLine();
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
double x = double.Parse(Console.ReadLine());// dobijamo vrednosti x
y
double y = double.Parse(Console.ReadLine());
double jednacina = ((1)/((-x/( Math.Abs(x) + Math.Abs(y) + 1)) +
(y/( Math.Abs(x) + Math.Abs(y) + 1)))) * Math.Sqrt(Math.Abs(x) + Math.Abs(y) +
1);
Console.WriteLine("Resenje je : {0}", jednacina);
Console.ReadLine();
}
}
}