为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

数字换成大写

2017-12-26 5页 doc 17KB 20阅读

用户头像

is_079973

暂无简介

举报
数字换成大写数字换成大写 ?úÂëÈçÏÂ?º using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace ConvertNumber { class Program { static void Main(string[] args) { GetZWNum(Console.ReadLine()); Console.ReadLine(); } ...
数字换成大写
数字换成大写 ?úÂëÈçÏÂ?º using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace ConvertNumber { class Program { static void Main(string[] args) { GetZWNum(Console.ReadLine()); Console.ReadLine(); } public static string GetZWNum(string strN) { string[] strNum = { "Ò?", "??", "Èþ", "ËÁ", "Îé", "Â?", "Æâ", "?Æ", "?Á" }; int bl = -1; bool ch = true; int len = strN.Length; if (len > 24) { Console.WriteLine("ÄúÊäÈëµÄÊý×Ö?ý?ó??ÎÞ??ת????"); return ""; } string strResult = ""; string[] strSZ = new string[len]; for (int i = 0; i < len; i++) { strSZ[i] = strN.Substring(i, 1); if (!Regex.IsMatch(strSZ[i], "^[0-9]$")) { Console.WriteLine("ÄúÊäÈëµÄÊý×Öº?ÓÐ?ÇÊý×Ö?ûºÅ??"); return ""; } if (strSZ[0] == "0" && ch)//?ìÑéÊ×Î??öÏÖÁãµÄÇé?ö { if (i != len - 1 && strSZ[i] == "0" && strSZ[i + 1] != "0") bl = i; else ch = false; } } for (int i = 0; i < len; i++) { int num = len - i; if (strSZ[i] != "0") { strResult += strNum[Convert.ToInt32(strSZ[i]) - 1];//????À,??Êý×Öת???ÉÖÐÎÄ?óÐ?Êý×Ö //?ÓÉϵ?Î? if (num % 4 == 2) strResult += "Ê?"; if (num % 4 == 3) strResult += "?Û"; if (num % 4 == 0) strResult += "Ǫ"; if (num % 4 == 1) { if (num / 4 == 1) strResult += "Èf"; if (num / 4 == 2) strResult += "ÒÚ"; if (num / 4 == 3) strResult += "Èf"; if (num / 4 == 4) strResult += "ÒÚ"; if (num / 4 == 5) strResult += "Èf"; } } else { if (i > bl) { if ((i != len - 1 && strSZ[i + 1] != "0" && (num - 1) % 4 != 0)) { //?Ë??ÅÐ?Ï??0????ÊÇ?öÏÖÔÚÄ?Î???ÇÒÏÂÒ?Î?Ò???ÊÇ??0???? //Èç 10012332 ÔÚ?Ë???Á??Ó??ÃΪÒ?ǪÁãÒ?Èf?? strResult += "Áã"; } if (i != len - 1 && strSZ[i + 1] != "0") { switch (num) { //?Ë???öÏÖµÄÇé?öÊÇÈç 10002332????0???öÏÖÔÚÍòÎ?ÉÏ?ÍÓ??Ã?ÓÉÏÒ??ö??Èf???Á?ÉÒ?ǪÈfÁã??ǪÈþ?ÛÈþÊ??? case 5: strResult += "Èf"; break; case 9: strResult += "ÒÚ"; break; case 13: strResult += "Èf"; break; } } if (i != len - 1 && strSZ[i + 1] != "0" && (num - 1) % 4 == 0) { //?Ë???öÏÖµÄÇé?öÊÇÈç 10002332????0???öÏÖÔÚÍòÎ?ÉÏ?ÍÓ??Ã?ÓÉÏÒ??ö??Áã???Á?ÉÒ?ǪÈfÁã??ǪÈþ?ÛÈþÊ??? strResult += "Áã"; } } } } return strResult; } } }
/
本文档为【数字换成大写】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索