Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using Library;
  6.  
  7. namespace Text
  8. {
  9.     class Program
  10.     {
  11.         static void Print_Index(string[] words)
  12.         {
  13.             for (int i = 0; i < words.Length; i++)
  14.             {
  15.                 Console.WriteLine(words[i]);
  16.             }
  17.         }
  18.  
  19.         static void Print<T>(T[] words)
  20.         {
  21.             foreach (var word in words)
  22.             {
  23.                 Console.WriteLine(word);
  24.             }
  25.         }
  26.  
  27.         static void Main(string[] args)
  28.         {
  29.             string text = "";
  30.             string become = "Ночью ";
  31.             while (become != "Конец")
  32.             {
  33.                 Console.WriteLine("Привет! Плести нить сюжета можно ВЕЧНО, однако если Вы все-таки заходите это остановить, то просто напишите: конец. Итак, пора начинать, продолжите предложение:");
  34.                 Console.Write(become);
  35.                 string continuation = Console.ReadLine();
  36.                 string[] words = continuation.Split(' ');
  37.  
  38.                 string one_word = words[words.Length - 1];
  39.                 char[] one_letters = one_word.ToCharArray();
  40.                 char big_one_letter = Char.ToUpper(one_letters[0]);
  41.  
  42.                 string part = new string(one_letters, 1, one_word.Length - 1);
  43.  
  44.                 text = text + become + continuation + " ";
  45.                 string new_one_word = big_one_letter + part;
  46.                 Console.Clear();
  47.  
  48.                 become = "";
  49.                 char[] new_one_word_char = new_one_word.ToCharArray();
  50.                 for (int i = 0; i < new_one_word_char.Length; i++)
  51.                 {
  52.                     if (Char.IsLetterOrDigit(new_one_word_char[i]) == true)
  53.                     {
  54.                         become = become + new_one_word_char[i];
  55.                     }
  56.                 }
  57.             }
  58.             Console.WriteLine("Вот что у Вас получилось: ");
  59.             Console.WriteLine();
  60.             Console.Write(text);
  61.             Console.WriteLine();
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement