Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Filip Adamovic, 1 AHIF
- // Wortsegel
- //21.04.2017
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Wortsegel
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Variablendeklaration: Zusätzlich Variable char antwort
- char antwort = 'j';
- int z, i;
- string txt, ntxt;
- do
- {
- z = 0;
- //Programmcode
- Console.Write("Geben sie einen Text ein: ");
- txt = Console.ReadLine();
- for (i = 0;i <= txt.Length - 1; i = i + 1)
- {
- ntxt = txt.Substring(0, txt.Length - z);
- Console.WriteLine(ntxt);
- z = z + 1;
- }
- do
- {
- Console.WriteLine("Wollen Sie das Programm wiederholen? (j/n): ");
- antwort = char.Parse(Console.ReadLine());
- } while (antwort != 'j' && antwort != 'J' && antwort != 'n' && antwort != 'N');
- } while (antwort == 'j' || antwort == 'J');
- }
- }
- }
- ZWEI:
- //Filip Adamovic, 1 AHIF
- // Zeilenlineal
- // 21.04.2017
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Zeilenlineal
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Variablendeklaration: Zusätzlich Variable char antwort
- char antwort = 'j';
- string txt;
- int i, z;
- do
- {
- //Programmcode
- z = 0;
- Console.Write("Geben sie einen Text ein: ");
- txt = Console.ReadLine();
- Console.WriteLine(txt);
- for (i = 0; i <= txt.Length; i = i + 1)
- {
- Console.Write(z);
- z = z + 1;
- if (z == 10)
- {
- z = 0;
- }
- }
- do
- {
- Console.WriteLine("Wollen Sie das Programm wiederholen? (j/n): ");
- antwort = char.Parse(Console.ReadLine());
- } while (antwort != 'j' && antwort != 'J' && antwort != 'n' && antwort != 'N');
- } while (antwort == 'j' || antwort == 'J');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement