diff --git a/assignment_1_group_1/Program.cs b/assignment_1_group_1/Program.cs index 34e0bb0..6eac70d 100644 --- a/assignment_1_group_1/Program.cs +++ b/assignment_1_group_1/Program.cs @@ -4,9 +4,28 @@ namespace assignment_1_group_1 { class Program { + public static string StringReverse(string s) + { + string result = ""; + string temp = ""; + for (int i = s.Length - 1; i >= 0; i--) + { + if (s[i] == ' ') + { + result = temp + " " + result; + temp = ""; + } + else + temp += s[i]; + } + result = temp + " " + result; + + Console.WriteLine(result); + } static void Main(string[] args) { - Console.WriteLine("Hello World!"); + string output = StringReverse("University of South Florida"); + Console.WriteLine(output); } } -} +} \ No newline at end of file