Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConU15E1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a, hilf1, hilf2, hilf3, summe;
- string temp;
- do
- {
- summe = 0;
- Console.Write("Zahlenfolge: ");
- temp = Console.ReadLine();
- a = Convert.ToInt32(temp);
- for (int i = 1; i <= a; i++)
- {
- Console.WriteLine();
- Console.Write("Zahl1: ");
- hilf1 = Convert.ToInt32(a);
- if (temp.ToUpper() == "STOP")
- {
- break;
- }
- Console.Write("Zahl2: ");
- hilf2 = Convert.ToInt32(a);
- if (temp.ToUpper() == "STOP")
- {
- break;
- }
- Console.Write("Zahl3: ");
- hilf3 = Convert.ToInt32(a);
- if (temp.ToUpper() == "STOP")
- {
- break;
- }
- summe = hilf1 + hilf2 + hilf3;
- }
- Console.Write("Summe: " + summe);
- Console.Write("Wollen Sie das Programm wiederholen J oder N: ");
- }
- while (Console.ReadLine().ToUpper() == "J");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement