C#帮助格式化控制台上的文本输出 [英] C# Help in Formatting Text Output at Console

查看:154
本文介绍了C#帮助格式化控制台上的文本输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以数学方式获得Outputs中的空格.它应该使用Modulus技术或算法方法.
例如

输入:12345
输出:1 2 3 4 5

一直在尝试,搜索和搜索....还没睡!

I want to get Spaces in Output in a mathematical way. It should go with something with Modulus technique or algorithmic approach.
For example

Enter: 12345
Output: 1 2 3 4 5

Been trying and searching and searching.... no sleep yet!

推荐答案

在用1 ...投票给我的第一个答案后.

After you voted my first answer with a 1...

flance99写道:
flance99 wrote:

尝试并搜索并搜索....还没睡!

Been trying and searching and searching.... no sleep yet!



因此,您正在寻找作业问题的答案.如果您确实在进行搜索和搜索",那么您将找到以下内容:

http://www.codeproject.com/Messages/3341745/Re-how-to-split-input-integer-variable-modified.aspx [



So, you''re looking for an answer to a homework question. If you really had been "searching and searching", you would have found this:

http://www.codeproject.com/Messages/3341745/Re-how-to-split-input-integer-variable-modified.aspx[^]

It looks like one of your classmates came here for an answer, too. While you''r4e looking at that, make sure you note who provided the answer he wanted, and make sure your read the entire post, because the note that follows the code applies to you, too.

I find it insulting that people taking a class on programming feel the need to scrounge around on established programmer sites looking for people to do they work they''re supposed to be doing so they can learn the craft. IMHO, you guys are nothing but losers that have apparently chosen the wrong occupation.

BTW, the reason this is insulting is because I have to compete against people like you in the workplace. I don''t mine losing out to a guy that''s as good as or better than I am, but losing out to someone because they''re cheaper yet not nearly as qualified really ticks me off.




您是否真的在寻找一种方法来分隔输入字符串中的字符?
IE.类似于
Are you really searching for a way to separate characters in a input string?
I.e. something similar to
String a = "12345";
foreach (char c in a)
{
  System.Console.Write(c);
  System.Console.Write('' '');
}
    System.Console.WriteLine();


?


为什么可以在框架中使用数学运算?

Why use math when you can do it with the framework?

int value = 12345;
string text = string.Format("{0:0 0 0 0 0}", value);


这篇关于C#帮助格式化控制台上的文本输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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