Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. string cont = "yes";
  2. string input;
  3. while(!(cont == "exit")){
  4. Console.WriteLine("Enter a sentence: ");
  5. input = Console.ReadLine();
  6.  
  7. string[ ] words = input.Split(' ');
  8.  
  9. Array.Reverse(words);
  10.  
  11. foreach(string word in words){
  12. Console.Write(word+" ");
  13. }
  14.  
  15. Console.WriteLine("\nIf you would like to quit, enter exit: ");
  16. cont = Console.ReadLine();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement