मैं लिख रहा हूँ मेरी पहली सी# एल्गोरिथ्म चुनौती है और मैं कर रहा हूँ में चल रहे एक समस्या है । मैं जोड़ा गया है के प्रकार की पहचान करने के लिए अपने सभी चर, लेकिन मैं अभी भी एक त्रुटि हो रही है कि एक पहचानकर्ता की उम्मीद है । मैं नहीं हूँ यकीन है कि मैं कैसे हल कर सकते हैं जब यह वास्तविक प्रकार पहचानकर्ता है. यहाँ है मेरे कोड और त्रुटि लॉग.
public class ShortLongShort
{
public static string Solution(string a, string b)
{
string long = a;
string short = b;
if(a.Length < b.Length) {
short = a;
long = b;
}
return short+long+short;
}
}
src/Solution.cs(5,12): error CS1001: Identifier expected
src/Solution.cs(5,12): error CS1002: ; expected
src/Solution.cs(5,17): error CS1001: Identifier expected
src/Solution.cs(6,12): error CS1001: Identifier expected
src/Solution.cs(6,12): error CS1002: ; expected
src/Solution.cs(6,18): error CS1001: Identifier expected
src/Solution.cs(8,15): error CS1001: Identifier expected
src/Solution.cs(9,14): error CS1001: Identifier expected
src/Solution.cs(11,12): error CS1525: Invalid expression term 'short'
src/Solution.cs(11,18): error CS1525: Invalid expression term 'long'
src/Solution.cs(11,23): error CS1525: Invalid expression term 'short'