Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
|
.-. | .-.
,´ `. |,´ `.
'-------\-------/-------\-------,
`. ,'| `. ,'
`-´ | `-´
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Parabel
{
class Program
{
static void Main(string[] args)
{
int x;
int y;
Console.WriteLine("Parabel");
Console.WriteLine("----------");
Console.WriteLine();
Console.WriteLine("Höhe?");
y = int.Parse(Console.ReadLine());
for (int i = y; i > 0; i--)
{
x = i*2;
for (int j = x; j > 0; j--)
{
if (j == 1)
{
Console.Write(".");
Console.WriteLine();
}
else
{
Console.Write(" ");
}
}
}
}
}
}
static void Main(string[] args)
{
Console.WriteLine("Sinus");
Console.WriteLine("----------");
Console.WriteLine();
Console.Write("Höhe? ");
int max = int.Parse(Console.ReadLine());
for (int y = max; y >= -max; y--)
{
for (int x = 0; x < Math.Round(max * 2 * Math.PI, 0); x++)
{
if ((int) Math.Round(Math.Sin((double) x / max) * max) == y)
Console.Write(":");
else
Console.Write(" ");
}
Console.WriteLine();
}
}
welche Fehlermeldung, welche Zeile? Bei mir lässt sich der Code ohne Probleme kompilieren.bei mir funktionierts nicht, er gibt mir einen fehler bei max und y
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Sinus");
Console.WriteLine("----------");
Console.WriteLine();
Console.Write("Höhe? ");
int ymax = int.Parse(Console.ReadLine());
int xmax = (int) Math.Round(ymax * 2 * Math.PI, 0);
Console.WriteLine();
for (int y = ymax; y >= -ymax; y--)
{
if (y == ymax)
Console.Write(" 1 ");
else if (y == 0)
Console.Write(" 0 ");
else if (y == -ymax)
Console.Write("-1 ");
else
Console.Write(" ");
for (int x = -xmax; x <= xmax; x++)
{
if ((int) Math.Round(Math.Sin((double) x / ymax) * ymax) == y)
Console.Write(":");
else if (x == 0)
Console.Write("|");
else
if (y == 0)
Console.Write("-");
else
Console.Write(" ");
}
Console.WriteLine();
}
}
}