Подскажите как, пожалуйста, решить
229
ОТВЕТЫ
1.
using System;
public class Test
{
public static void Main()
{
int a,b;
Console.Write("a = ");
a = int.Parse(Console.ReadLine());
Console.Write("b = ");
b = int.Parse(Console.ReadLine());
if (agt;b) Console.WriteLine("{0} gt; {1}", a, b);
else if (alt;b) Console.WriteLine("{0} lt; {1}", a, b);
else Console.WriteLine("{0} = {1}", a, b);
Console.ReadLine();
}
}
Пример:
a = 15
b = 28
15 lt; 28
2.
using System;
class Program
{
public static void Main()
{
double y1, y2, h = 10;
Console.WriteLine("x sin(x) cos(x)");
for (double x = 0; x lt;= 90; x = x+h) {
y1 = Math.Sin(x*Math.PI/180);
y2 = Math.Cos(x*Math.PI/180);
Console.WriteLine("{0} {1:0.0000} {2:0.0000}",x,y1,y2);
}
Console.ReadKey();
}
}
Результат:
x sin(x) cos(x)
0 0.0000 1.0000
10 0.1736 0.9848
20 0.3420 0.9397
30 0.5000 0.8660
40 0.6428 0.7660
50 0.7660 0.6428
60 0.8660 0.5000
70 0.9397 0.3420
80 0.9848 0.1736
90 1.0000 0.0000
using System;
public class Test
{
public static void Main()
{
int a,b;
Console.Write("a = ");
a = int.Parse(Console.ReadLine());
Console.Write("b = ");
b = int.Parse(Console.ReadLine());
if (agt;b) Console.WriteLine("{0} gt; {1}", a, b);
else if (alt;b) Console.WriteLine("{0} lt; {1}", a, b);
else Console.WriteLine("{0} = {1}", a, b);
Console.ReadLine();
}
}
Пример:
a = 15
b = 28
15 lt; 28
2.
using System;
class Program
{
public static void Main()
{
double y1, y2, h = 10;
Console.WriteLine("x sin(x) cos(x)");
for (double x = 0; x lt;= 90; x = x+h) {
y1 = Math.Sin(x*Math.PI/180);
y2 = Math.Cos(x*Math.PI/180);
Console.WriteLine("{0} {1:0.0000} {2:0.0000}",x,y1,y2);
}
Console.ReadKey();
}
}
Результат:
x sin(x) cos(x)
0 0.0000 1.0000
10 0.1736 0.9848
20 0.3420 0.9397
30 0.5000 0.8660
40 0.6428 0.7660
50 0.7660 0.6428
60 0.8660 0.5000
70 0.9397 0.3420
80 0.9848 0.1736
90 1.0000 0.0000
70
Отв. дан
Malobandis
Для написания вопросов и ответов необходимо зарегистрироваться на сайте
Другие вопросы в разделе - Информатика
Cekus
Подскажите как пожалуйста . описать обьекты в данном проэкте, ...
2018-10-23 01:27:30
Molsa
Информатика,9класс,кодирование информации. Нужно до завтра до 14:00.(23 марта) . ...
2018-10-23 01:27:15
Kelenis
Pascal ABC с входными, выходными, промежуточными данными, алгоритмом и ...
2018-10-23 01:27:06
Matius
Паскаль ABC............................................ ...
2018-10-23 01:25:55