private static int Abc() { 列表与LT; INT> result = new List< int>(); byte [] numbers = GetValue(); string selectedItems ="" ;; int j = 0; for(int i = 0; i< 18; i ++) { j ++; selectedItems + = numbers [i]; if(j == 3) { result.Add(getDecimal(selectedItems)); j = 0; selectedItems ="" ;; }¥b $ b }¥b $ b Console.WriteLine(); Console.WriteLine(" Result is:"); $ foreach(结果中的var项目) { Console.Write(item); }¥b $ b Console.ReadLine(); }
private static int Abc() { List<int> result = new List<int>(); byte[] numbers = GetValue(); string selectedItems = ""; int j = 0; for (int i = 0; i < 18; i++) { j++; selectedItems += numbers[i]; if (j == 3) { result.Add(getDecimal(selectedItems)); j = 0; selectedItems = ""; } } Console.WriteLine(); Console.WriteLine("Result is:"); foreach (var item in result) { Console.Write(item); } Console.ReadLine(); }
推荐答案
愿这个帮助你
你应该在最后返回int
You should return int at the end
private static int Abc() { int intVal = 0; List<int> result = new List<int>(); byte[] numbers = GetValue(); string selectedItems = ""; int j = 0; for (int i = 0; i < 18; i++) { j++; selectedItems += numbers[i]; if (j == 3) { result.Add(getDecimal(selectedItems)); j = 0; selectedItems = ""; } } Console.WriteLine(); Console.WriteLine("Result is:"); foreach (var item in result) { Console.Write(item); } Console.ReadLine(); return intVal; }或使用void返回任何内容
or use void to return nothing as
private static void Abc()最好的问候 Vikram Manjare 请记住点击"标记为答案" ;解决您的问题的回复,并点击"取消标记为答案"如果不。这对阅读此主题的其他社区成员有益。
Best Regards Vikram Manjare Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.
更多推荐
获取错误:并非所有代码路径都返回值
发布评论