添加输入的中位数 [英] add the mid number of input

查看:105
本文介绍了添加输入的中位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我想在C#控制台中创建一个程序.以给定的格式从用户那里接受5次输入:A 2 1
B 3 3
A 1 3
A 4 2
B 2 2
我想添加所有中位数的输入,但是我很困惑该怎么做.请告诉我该怎么做.
在此先感谢

hi!
i want to create a program in c# console. that takes 5 input from the user in the given format: A 2 1
B 3 3
A 1 3
A 4 2
B 2 2
i want to add all the mid numbers of input but i am confuse how to do it. please tell me how to do it.
thanks in advance

推荐答案

如果任何行是字符串,您都可以这样做
if any line is a string you can do that
string line = "a 1 2";
string[] splitedLine = line.Split('' '');
string part = splitedLine[1];


这篇关于添加输入的中位数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆