10-digit conversion and matching of parentheses

Source: Internet
Author: User

10-digit conversion and Matching Algorithm in parentheses: (if you have any bugs, please advise)

1: Convert decimal to other hexadecimal values, including binary, octal, and hexadecimal.

2: brackets matching algorithm, matching with corresponding brackets.

Hexadecimal conversion algorithm and character Matching Algorithm 1 using System. Collections. Generic;
2 using System. Text;
3
4 public partial class DataStruct_ExchangeData: System. Web. UI. Page
5 {
6 protected void Page_Load (object sender, EventArgs e)
7 {
8
9 // ConvertIntToOther ();
10 // ConvertionInt (654321,8 );
11 MatchBreak ("([]) ([] [()])");
12}
13 /// <summary>
14 // compare the match of the string
15 /// </summary>
16 /// <param name = "input"> input string to compare </param>
17 private void MatchBreak (string input)
18 {
19 char [] charnum = input. ToCharArray ();
20 Stack <string> stack = new Stack <string> ();
21 foreach (char ch in charnum ){
22 if (stack. Count = 0) {// press when the number is 0
23 stack. Push (ch. ToString ());
24}
25 else
26 {
27 & nbs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.