Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. //Filip Adamovic, 1 AHIF
  2. // Wortsegel
  3. //21.04.2017
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10. namespace Wortsegel
  11. {
  12. class Program
  13. {
  14. static void Main(string[] args)
  15. {
  16. //Variablendeklaration: Zusätzlich Variable char antwort
  17. char antwort = 'j';
  18. int z, i;
  19. string txt, ntxt;
  20. do
  21. {
  22. z = 0;
  23.  
  24. //Programmcode
  25.  
  26.  
  27. Console.Write("Geben sie einen Text ein: ");
  28. txt = Console.ReadLine();
  29. for (i = 0;i <= txt.Length - 1; i = i + 1)
  30. {
  31. ntxt = txt.Substring(0, txt.Length - z);
  32. Console.WriteLine(ntxt);
  33. z = z + 1;
  34. }
  35.  
  36.  
  37. do
  38. {
  39. Console.WriteLine("Wollen Sie das Programm wiederholen? (j/n): ");
  40. antwort = char.Parse(Console.ReadLine());
  41.  
  42. } while (antwort != 'j' && antwort != 'J' && antwort != 'n' && antwort != 'N');
  43.  
  44. } while (antwort == 'j' || antwort == 'J');
  45.  
  46. }
  47. }
  48. }
  49.  
  50. ZWEI:
  51. //Filip Adamovic, 1 AHIF
  52. // Zeilenlineal
  53. // 21.04.2017
  54. using System;
  55. using System.Collections.Generic;
  56. using System.Linq;
  57. using System.Text;
  58. using System.Threading.Tasks;
  59.  
  60. namespace Zeilenlineal
  61. {
  62. class Program
  63. {
  64. static void Main(string[] args)
  65. {
  66. //Variablendeklaration: Zusätzlich Variable char antwort
  67. char antwort = 'j';
  68. string txt;
  69. int i, z;
  70.  
  71. do
  72. {
  73.  
  74. //Programmcode
  75.  
  76. z = 0;
  77. Console.Write("Geben sie einen Text ein: ");
  78. txt = Console.ReadLine();
  79. Console.WriteLine(txt);
  80. for (i = 0; i <= txt.Length; i = i + 1)
  81. {
  82. Console.Write(z);
  83. z = z + 1;
  84. if (z == 10)
  85. {
  86. z = 0;
  87. }
  88. }
  89.  
  90. do
  91. {
  92. Console.WriteLine("Wollen Sie das Programm wiederholen? (j/n): ");
  93. antwort = char.Parse(Console.ReadLine());
  94.  
  95. } while (antwort != 'j' && antwort != 'J' && antwort != 'n' && antwort != 'N');
  96.  
  97. } while (antwort == 'j' || antwort == 'J');
  98.  
  99. }
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement