制作角色组合 [英] making combinations of characters

查看:62
本文介绍了制作角色组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要求用户输入n个字符(字母,数字,字符或任何内容)。一旦他点击执行按钮,用户输入的那些字符的所有可能组合应该显示在屏幕上,包括组合的计数。用户应该能够根据他的要求对结果进行整理或过滤。

任何人都可以建议使用这种方法吗?

解决方案

你可以使用递归方法。

或者,如果你有点懒,你也可以谷歌(或者你可能会读到这个 CodeProject 的文章:使用C#Generics的排列,组合和变体 [ ^ ]

A user is asked to enter n number of characters (alphabets, number, characters or anything). as soon as he clicks on the execute button, all the possible combinations of those characters entered by the user should be displayed on the screen including the count of the combinations. the user should be able to sort out or filter the results as per his requirements.
can anyone suggest the approach to be used?

解决方案

You may use a recursive approach.
Or, if you are a bit lazy, you may also Google for (or you may read this CodeProject''s article: Permutations, Combinations, and Variations using C# Generics[^].


这篇关于制作角色组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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