Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
5555555
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.IO; namespace Rextester { public class Program { //Functions public static double Left(double R, double x, ref double y) { y = R - Math.Sqrt(-(x*x) - 2*x*R); //Console.WriteLine("L_y= " + y); return y; } public static double Right(double R, double x, ref double y) { y = -R + Math.Sqrt(-(x*x) + 2*x*R); Console.WriteLine("R_y= " + y); return y; } public static void Main(string[] args) { //Your code goes here //Console.WriteLine("Hello, world!"); Console.WriteLine("LABA2_ZAD2"); //arguments double x=0,y=0, R=1; double a=0, b = 0; //выстрел снайпера (x:y) char L_R; //execution Console.WriteLine("enter R"); R = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("enter x"); a = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("enter y"); b = Convert.ToDouble(Console.ReadLine()); x=R; y=R; Console.WriteLine("R={0,3}; a={1,3}; b={2,3}", R,a,b); Console.WriteLine("R={0,3}; x={1,3}; y={2,3}", R,x,y); //Left(R,x,ref y); //Right(R,x,ref y); /* switch (L_R) { case 'L' : if (R> Math.Sqrt(a*a+b*b)) default : break; } */ if (a<0 && b>-R && b<Left(R,a,ref b)) {Console.WriteLine("left"); Console.WriteLine("L_y= " + y);}//{L_R = 'L';} else {L_R='R';} if (Math.Abs(a)>R && Math.Abs(b)>R ) {Console.WriteLine("MIMO");} } } }
2 -1 5
Show compiler warnings
[
-
]
Show input
Compilation time: 0,17 sec, absolute running time: 0,11 sec, cpu time: 0,09 sec, average memory usage: 14 Mb, average nr of threads: 3
fork mode
|
history
|
discussion
LABA2_ZAD2 enter R enter x enter y R= 2; a= -1; b= 5 R= 2; x= 2; y= 2