You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Übung_Ware_Einpacken
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
//Deklarationen
|
|
int anz_flaschen, anz_12er, anz_6er, anz_2er, anz_1er, rest;
|
|
|
|
//Header
|
|
Console.WriteLine("--Kartonerrechner--");
|
|
|
|
//Eingabe
|
|
Console.Write("Geben Sie die Anzahl Flaschen an: ");
|
|
|
|
//Berechnung
|
|
anz_flaschen= Convert.ToInt32(Console.ReadLine());
|
|
|
|
anz_12er = anz_flaschen / 12;
|
|
rest = anz_flaschen % 12;
|
|
|
|
anz_6er = rest /6;
|
|
rest = rest % 6;
|
|
|
|
anz_2er = rest / 2;
|
|
rest = rest % 2;
|
|
|
|
anz_1er = rest ;
|
|
|
|
//Ausgabe
|
|
|
|
Console.WriteLine("Anzahl 12er Kartons: "+anz_12er);
|
|
Console.WriteLine("Anzahl 6er Kartons: " + anz_6er);
|
|
Console.WriteLine("Anzahl 2er Kartons: " + anz_2er);
|
|
Console.WriteLine("Anzahl einzel Flaschen: " + anz_1er);
|
|
|
|
Console.ReadLine();
|
|
|
|
|
|
}
|
|
}
|
|
}
|