需要帮助我的程序 [英] need help for my program

查看:99
本文介绍了需要帮助我的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要制作一个程序,用户可以在其中输入一个字符串,然后输出将如本示例中所示
当用户输入
我叫桑德拉
输出将是
M:*
y:*
n:**
a:***
m:*
e:*
我:*
s:*
S:*
d:*
r:*

请帮我解决我的程序很多问题.谢谢:confused:

i need to make a program in which the user can enter a string and output will be as shown in this example
when the user enters
My name is Sandra
the output will be
M : *
y : *
n : **
a : ***
m : *
e : *
i : *
s : *
S : *
d : *
r : *

please help me with my program I''v tried alot .thanks:confused:

推荐答案

U可以解析每个字符的文本并用Char更新字典类型作为键,类型为值.

如果酌处者已经拥有您的char(解析char),则将值递增1,否则为该char添加一个新条目,其Value为1.

现在,您获得了所需的值,然后只需输入Console.Writeline/console.write即可打印所需的输出格式..!!!

干杯
Bharathi Raja:)
U can just parse thru the text for each characters and update a dictionary with Char type as Key and Int type as Value.

If the disctionary is already having your char(Parsing char), thn incremant the value by one, else add a new entry for that char with Value as 1.

Now u got the desired values, then its just Console.Writeline/console.write to print the desired output format..!!!

Cheers
Bharathi Raja :)


这不是一项艰巨的任务,您只需要遍历字符串即可.您对此有何疑问?
:)
It isn''t a daunting task, you just need to traverse the string. What is your doubt about?
:)


请为我编写代码,还是告诉我如何使用它:(((
would you please write the code for me or just tell me how to step to it :((


这篇关于需要帮助我的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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