28 lines
576 B
C#
28 lines
576 B
C#
using System;
|
|
|
|
public class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
double x, x1, x2, y;
|
|
|
|
Console.WriteLine("input x1:");
|
|
x1 = double.Parse(Console.ReadLine());
|
|
Console.WriteLine("input x2:");
|
|
x2 = double.Parse(Console.ReadLine());
|
|
|
|
Console.WriteLine("x\t\t sin(x)");
|
|
Console.WriteLine("--------------------------");
|
|
|
|
x = x1;
|
|
do
|
|
{
|
|
y = Math.Sin(x);
|
|
Console.WriteLine($"{x:F2}\t {y:F6}");
|
|
x = x + 0.01;
|
|
}
|
|
while (x <= x2);
|
|
}
|
|
}
|
|
|