forked from AAgulay/PushTesting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
43 lines (37 loc) · 1.06 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
namespace helloworld
{
class Program
{
private static int[] arr = { 1, 6, 3, 8, 2, 3, 7, 4 };
static void Main(string[] args)
{
pigLatin();
}
public static void pigLatin() {
Console.Write("Enter input: ");
string str = Console.ReadLine();
Console.WriteLine(pigLat(str));
}
public static string pigLat(string input) {
string piglat = "";
int temp = 0;
string tempchar="";
for (int k = 0; k < input.Length; k++) {
if(k==temp){
tempchar = input[k].ToString();
}
else if (!input[k].ToString().Equals(" "))
{
piglat = piglat + input[k];
}
else {
piglat = piglat + tempchar + "ay ";
temp = k + 1;
}
}
piglat = piglat = piglat + tempchar + "ay";
return piglat;
}
}
}