如何使用csharp生成一个字母表列表? [英] how to generate a list a alphabet using csharp?

查看:81
本文介绍了如何使用csharp生成一个字母表列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候


i我想知道这里的专家是否可以告诉我如何做到这一点或指向正确的方向(网址...

i希望使用c#生成一个字母表列表,例如

ABC ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZ


任何建议都将不胜感激


谢谢



greetings

i am just wondering if some expert here can either show me how to do this or point me to the right direction (url...

i want to use c# to generate a list of alphabet e.g
A B C ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZ

any suggestion will be greatly appreciated

thank you
on

推荐答案

Google:" c#" +" recursion"


-

<%= Clinton Gallagher

A / E / C咨询,网页设计,电子商务软件开发

Wauwatosa,密尔沃基县,威斯康星州美国

NET csgallagher @ REMOVETHISTEXT metromilwaukee .com

URL http://www.metromilwaukee.com/ clintongallagher /


" one" on *********** @ online.nospam>在留言中写道

新闻:AF *** ******************************* @ microsof t.com ...
Google: "c#"+"recursion"

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"one" <on***********@online.nospam> wrote in message
news:AF**********************************@microsof t.com...
问候,

我只是想知道这里的专家是否可以告诉我该怎么做或
指向我正确的方向(网址...)
我想用c#来生成一个字母表列表,例如
ABC ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZZ

任何建议都将不胜感激。
<谢谢
一个
greetings,

i am just wondering if some expert here can either show me how to do this or point me to the right direction (url...)
i want to use c# to generate a list of alphabet e.g.
A B C ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZZ

any suggestion will be greatly appreciated.

thank you
one



不,废话结果太多了。其中大部分都展示了如何使用for循环,while循环等


任何其他(更多)精确搜索


----- clintonG写道:----


Google:" c#" +" recursion


-

<%= Clinton Gallaghe

A / E / C咨询,网页设计,电子商务软件开发

Wauwatosa,密尔沃基县,威斯康星州美国

NET csgallagher @ REMOVETHISTEXT metromilwaukee.co

URL http:// www.metromilwaukee.com/clintongallagher


" one" <有关*********** @ online.nospam>在消息中写道

新闻:AF ********************************** @ microsof t.com ..
no, too many crap result. most of them show how to use for loop, while loop etc

any other (more) precise search

----- clintonG wrote: ----

Google: "c#"+"recursion

--
<%= Clinton Gallaghe
A/E/C Consulting, Web Design, e-Commerce Software Developmen
Wauwatosa, Milwaukee County, Wisconsin US
NET csgallagher@ REMOVETHISTEXT metromilwaukee.co
URL http://www.metromilwaukee.com/clintongallagher

"one" <on***********@online.nospam> wrote in messag
news:AF**********************************@microsof t.com..
问候
我只是想知道这里是否有专家可以告诉我如何做到这一点o
指向正确的方向( url ...我想用c#生成一个字母表列表,例如
i am just wondering if some expert here can either show me how to do this o point me to the right direction (url... i want to use c# to generate a list of alphabet e.g


ABC ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZ


A B C ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZ

任何建议将不胜感激
谢谢你
any suggestion will be greatly appreciated
thank yo




>>>我想要使用c#生成一个字母表列表,例如
> >> i want to use c# to generate a list of alphabet e.g.
> ABC ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZZ
> A B C ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZZ
>>任何建议都将不胜感激。
>> any suggestion will be greatly appreciated.




我不知道为什么这有参与递归。


首先确定究竟是什么 你在做。我认为以下是您想到的

模式:


(1)如果字符串不以Z结尾,则将其最后一个字母更改为字母表中的下一个

字母。


因此A后跟B,AA后面是AB,BLITHERA是

其次是BLITHERB等。


(2)如果字符串*确实*以Z结尾,那么,从结束开始,回到

直到你找到一个不是Z的字母,并将其改为

字母表中的下一个字母;然后用A取代之后的所有字母。


因此AZZ紧跟BAA。


(3)但如果你得到所有的开始的时候有所有的Z',然后

用一个字母改成所有A'。


因此跟随ZZZ由AAAA。

至少我认为*这就是你的想法。是吗?如果是这样,它应该很容易用StringBuilder(这是可变的,不像String)和一些

简单的程序逻辑。

步骤(2)和(3)可以合并,因为从最后开始,你用'A'代替Z'的


PS当你上完作业时一定要肯定我...如果这是

作业。


-

- -------------------------------------------------- -------------------------

---------

Michael A. Covington,副主任

人工智能中心,佐治亚大学
http://www.ai.uga.edu/~mc



I don''t see why this has to involve recursion.

First decide exactly what you''re doing. I think the following is the
pattern you have in mind:

(1) If the string does not end in Z, then change its last letter to the next
letter in the alphabet.

Thus A is followed by B, AA is followed by AB, BLITHERA is
followed by BLITHERB, etc.

(2) If the string *does* end in Z, then, starting from the end, work back
until you find a letter that is not Z, and change it to the next letter in
the alphabet; then replace all the letters after it with A.

Thus AZZ is followed by BAA.

(3) But if you get all the way to the beginning and have all Z''s, then
change it to all A''s with one more letter.

Thus ZZZ is followed by AAAA.
At least I *think* that''s what you have in mind. Is it? If so, it should
be easy to do with StringBuilder (which is mutable, unlike String) and some
simple program logic.
Steps (2) and (3) can be consolidated because, starting from the end, you''re
replacing Z''s with A''s.
P.S. Be sure to acknowledge me when you turn in your homework... if this is
homework.

--
----------------------------------------------------------------------------
---------
Michael A. Covington, Associate Director
Artificial Intelligence Center, The University of Georgia
http://www.ai.uga.edu/~mc


这篇关于如何使用csharp生成一个字母表列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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