当前位置: 首页 > news >正文

沧州建网站成都平台网站建设公司排名

沧州建网站,成都平台网站建设公司排名,万众城网站建设,厦门网站建设哪家比较好1.数组元素和 2.数组元素乘积 3.数组元素平均数 4.数组中最大值 5.数组中的偶数 6.数组中的阶乘 7.数组反转 8.字符串反转 9.回文字符串 10.检查回文 11.最小最大值 12.找素数 13.字符串中的最长无重复字符串 14.字符串去重 15.数组中计算两数之和 16.数字到字符…1.数组元素和 2.数组元素乘积 3.数组元素平均数 4.数组中最大值 5.数组中的偶数 6.数组中的阶乘 7.数组反转 8.字符串反转 9.回文字符串 10.检查回文 11.最小最大值 12.找素数 13.字符串中的最长无重复字符串 14.字符串去重 15.数组中计算两数之和 16.数字到字符串转换(56fifty-six) 17.简单的日期格式化 18.简单计算器 int[] number { 1, 2, 3,5,6,11 }; 1.Console.WriteLine(数组的和是Arraynum.Numarry(number)); 2.Console.WriteLine(数组的乘和是Arraynum.Num1(number)); 3.Console.WriteLine(平均后保留两位小数是(double)Math.Round((Arraynum.Numarry(number)/(double)(number.Length)),2));Arraynum arrnew Arraynum(); 4.Console.WriteLine(数组的平均数是arr.Numaverage(number)); 5.Console.WriteLine(数组的最大值是arr.MaxValue(number));ArrayList arrayListc arr.Arraylista(number); 6.Console.Write(数组中的偶数是);foreach(int x in arrayListc){Console.Write(x\t);}Console.WriteLine(); 7.arr.ArrayJiecheng(number); 8.arr.NumberZ(number); 9.Console.WriteLine(\n请输入字符串);string str1Console.ReadLine();arr.ReverString1(str1); 10.arr.IsPalindrome(str1); 11.arr.Bothvalue(number); 12.Console.WriteLine(请输入1-10之间的数);int number5Convert.ToInt32(Console.ReadLine());arr.Mathmatics(number5); 13.arr.LengthOfstring(str1); 14.Console.WriteLine(请输入字符串);string inputConsole.ReadLine();arr.ReverQu(input); 15.int[] num {1,5,6,8,11,4 };Console.WriteLine(请输入你想要的值);int largeint.Parse(Console.ReadLine());arr.Fintwonum(num, large); 16.Console.WriteLine(请输入1000以内的数字);int numbers1int.Parse(Console.ReadLine());NumberTowards numberTowards new NumberTowards();numberTowards.ConvertNumberToWords(numbers1); 17.Date datenew Date();date.FormatDate(); 18.double o;char z;double y;Computer.Num(out o,out z,out y); --------------------------------------------------------------------------class Arraynum{#region 数组元素和public static int Numarry(int[] array){int num 0;foreach (int i in array){num i;}return num;}#endregion#region 数组元素乘积public static int Num1(int[] array){int num 1;foreach (int i in array){num * i;}return num;}#endregion#region 数组元素平均数public double Numaverage(int[] array){double sum 0;foreach (int i in array){sum i;}double zMath.Round((sum/(double)array.Length),2);return z;}#endregion#region 数组中最大的值public int MaxValue (int[]arry){int max arry[0];for (int i 1; i arry.Length; i){if (arry[i] max){max arry[i];}}return max;}#endregion#region 数组中的偶数1public static void Arraylist(int[] array){ArrayList arrayList new ArrayList();foreach (int i in array){if (i % 2 0){arrayList.Add(i);}}Console.Write(数组中偶数是);foreach (int i in arrayList){Console.Write( i \t);}}#endregion#region 数组中偶数2public ArrayList Arraylista(int[]array){ArrayList arrayListb new ArrayList();foreach (var item in array){if (item % 2 0){arrayListb.Add(item);}}return arrayListb;}#endregion#region 数组的阶乘public void ArrayJiecheng(int[]array){for (int i 0; i array.Length; i){if(array[i] 0){throw new Exception(${array[i]}不符合必须是非负整数);}long JC 1;for(int j 1; j array[i]1;j){JC JC * j;}Console.Write(array[i] 的阶乘是 JC\t);}}#endregion#region 数组反转public void NumberZ(int[]array){Console.Write(\n反转后的数组是:);string s ;for(int iarray.Length-1; i0; i--){s array[i];}Console.Write(s);}#endregion#region 字符串反转public void ReverString1(string str){char[] chars str.ToCharArray();Array.Reverse(chars);string ab ;Console.Write(反转后的字符串是:);foreach (char c in chars){Console.Write(c);ab ab c;}}#endregion#region 字符串反转2public string ReverString(string str4){char[] chars str4.ToCharArray();Array.Reverse(chars);string ab ;foreach (char c in chars){Console.Write(c);ab ab c;}return ab;}#endregion#region 回文字符串public bool IsString(string str2){int left 0;int right str2.Length-1;while (left right){if (str2[left] ! str2[right]){return false;}left;right--;}return true;}#endregion#region 检查回文public void IsPalindrome(string str){Console.WriteLine();string reversedStr ReverString(str);if( str reversedStr){Console.WriteLine($是回文);}else{Console.WriteLine($不是回文);}}#endregion#region 最大最小值public void Bothvalue(int[]array){int Max array[0];int Minarray[0];foreach (int i in array){if(i Max){Max i;}if (i Min){Min i;}}Console.Write($最大值是{Max},最小值是{Min});}#endregion#region 找素数public void Mathmatics(int number5){switch(number5){case 2:case 3:case 5:case 7:Console.WriteLine(你输入的是素数);break;case 0:case 1:case 6:case 4:case 8:case 9:case 10:Console.WriteLine(不是素数);break;default:break;}}#endregion#region 字符串中的最长无重复子串public void LengthOfstring(string str){Dictionarychar,int dict new Dictionarychar,int();int left 0, maxLength 0;for(int right0;rightstr.Length;right){if(dict.ContainsKey(str[right])){leftMath.Max(left, dict[str[right]]1);}dict[str[right]] right;maxLengthMath.Max(maxLength, right-left1);}Console.WriteLine(字符串中的最长无重复子串的最大值是maxLength);}#endregion#region 字符串去重public void ReverQu(string str){ArrayList array2 new ArrayList();foreach(char m in str){if(!array2.Contains(m)){array2.Add(m);}}for(int i0;iarray2.Count;i){Console.Write(array2[i]);}}#endregion#region 数组中计算两数之和public void Fintwonum(int[]nums,int large){Dictionaryint,int dict new Dictionaryint,int();for(int i0;inums.Length;i){int computlarge-nums[i];if (dict.ContainsKey(comput)){Console.WriteLine($有两数之和,这两个数的索引是{dict[comput]}和{i});}if (!dict.ContainsKey(nums[i])){dict[nums[i]] i;}}throw new Exception(Sorry,you have no idea);}#endregion}#region 数字到字符串转换(56fifty-six)class NumberTowards{private readonly Liststring numbers new Liststring{zero, one, two, three, four,five, six, seven, eight, nine,ten, eleven, twelve, thirteen, fourteen,fifteen, sixteen, seventeen, eighteen, nineteen};private readonly Liststring ten new Liststring{, , twenty, thirty, forty,fifty, sixty, seventy, eighty, ninety};public void ConvertNumberToWords(int number){if (number1||number999){throw new ArgumentException(Number must be between 1 and 999);}if(number0number20){Console.WriteLine($转换后是{numbers[number]});}if(number20number100){int tenpart number / 10;int ge number % 10;Console.WriteLine($转换后是{ten[tenpart]}{(ge 0 ? - numbers[ge]:)});}if(number100number1000){int hunderdpartnumber / 100;int remainder number % 100;int tender number / 10 % 10;int geder number % 10;string result numbers[hunderdpart] - hundred;if(remainder20){result and (ten[tender] (geder 0 ? - numbers[geder]:));}else if(remainder0remainder20){result and numbers[remainder];}Console.WriteLine($转换后是{result});}}}#endregion#region 简单的日期格式化class Date{public void FormatDate(){DateTime dateTime DateTime.Now;string yeardateTime.Year.ToString();string monthdateTime.Month.ToString();string daydateTime.Day.ToString();Console.WriteLine(${year}年{month}月{day}日);}}#endregion#region 简单的计算器class Computer{public static void Num(out double a,out char s,out double b){#region 方法1//switch (s)//{// case :// Console.WriteLine(${a}{b}的结果是{a b});// break;// case -:// Console.WriteLine(${a}-{b}的结果是{a - b});// break;// case *:// Console.WriteLine(${a}*{b}的结果是{a * b});// break;// case /:// if (b ! 0)// Console.WriteLine(${a}/{b}的结果是{a / b});// else// throw new Exception(除数不能为0);// break;// default:// throw new Exception(运算符只有 - * /);//}#endregionConsole.WriteLine(请输入第一个数);adouble.Parse(Console.ReadLine());Console.WriteLine(请输入符号);A:s char.Parse(Console.ReadLine());if(s!s!-s!*s!/){Console.WriteLine (请输入正确的符号);goto A;}Console.WriteLine(请输入第二个数);B:b double.Parse(Console.ReadLine());if(s/b0){Console.WriteLine(除数不能等于0,请重新输入);goto B;}if(s){Console.WriteLine(结果是(ab));}else if(s-){Console.WriteLine(结果是 (a - b));}else if(s*){Console.WriteLine(结果是 (a * b));}else{Console.WriteLine(结果是 (double)Math.Round((a /b),2));}}}#endregion
文章转载自:
http://www.morning.hzqjgas.com.gov.cn.hzqjgas.com
http://www.morning.mqghs.cn.gov.cn.mqghs.cn
http://www.morning.msmtf.cn.gov.cn.msmtf.cn
http://www.morning.wmmtl.cn.gov.cn.wmmtl.cn
http://www.morning.bmgdl.cn.gov.cn.bmgdl.cn
http://www.morning.nqmhf.cn.gov.cn.nqmhf.cn
http://www.morning.pbtdr.cn.gov.cn.pbtdr.cn
http://www.morning.hylbz.cn.gov.cn.hylbz.cn
http://www.morning.tqbqb.cn.gov.cn.tqbqb.cn
http://www.morning.lxcwh.cn.gov.cn.lxcwh.cn
http://www.morning.jncxr.cn.gov.cn.jncxr.cn
http://www.morning.pxwzk.cn.gov.cn.pxwzk.cn
http://www.morning.mqmxg.cn.gov.cn.mqmxg.cn
http://www.morning.hjlsll.com.gov.cn.hjlsll.com
http://www.morning.qckwj.cn.gov.cn.qckwj.cn
http://www.morning.stxg.cn.gov.cn.stxg.cn
http://www.morning.gcfrt.cn.gov.cn.gcfrt.cn
http://www.morning.mfrb.cn.gov.cn.mfrb.cn
http://www.morning.brwwr.cn.gov.cn.brwwr.cn
http://www.morning.qdlnw.cn.gov.cn.qdlnw.cn
http://www.morning.cltrx.cn.gov.cn.cltrx.cn
http://www.morning.gccdr.cn.gov.cn.gccdr.cn
http://www.morning.pluimers.cn.gov.cn.pluimers.cn
http://www.morning.trnhy.cn.gov.cn.trnhy.cn
http://www.morning.nflpk.cn.gov.cn.nflpk.cn
http://www.morning.dnpft.cn.gov.cn.dnpft.cn
http://www.morning.zcfmb.cn.gov.cn.zcfmb.cn
http://www.morning.gmgyt.cn.gov.cn.gmgyt.cn
http://www.morning.frsbf.cn.gov.cn.frsbf.cn
http://www.morning.crqpl.cn.gov.cn.crqpl.cn
http://www.morning.pcwzb.cn.gov.cn.pcwzb.cn
http://www.morning.jlmrx.cn.gov.cn.jlmrx.cn
http://www.morning.mdwtm.cn.gov.cn.mdwtm.cn
http://www.morning.rdmz.cn.gov.cn.rdmz.cn
http://www.morning.xmxbm.cn.gov.cn.xmxbm.cn
http://www.morning.psdsk.cn.gov.cn.psdsk.cn
http://www.morning.xsrnr.cn.gov.cn.xsrnr.cn
http://www.morning.jghty.cn.gov.cn.jghty.cn
http://www.morning.gzzncl.cn.gov.cn.gzzncl.cn
http://www.morning.mkfr.cn.gov.cn.mkfr.cn
http://www.morning.knnhd.cn.gov.cn.knnhd.cn
http://www.morning.rmfwh.cn.gov.cn.rmfwh.cn
http://www.morning.ghfmd.cn.gov.cn.ghfmd.cn
http://www.morning.kryr.cn.gov.cn.kryr.cn
http://www.morning.ptwqf.cn.gov.cn.ptwqf.cn
http://www.morning.nzqmw.cn.gov.cn.nzqmw.cn
http://www.morning.jtjmz.cn.gov.cn.jtjmz.cn
http://www.morning.wmyqw.com.gov.cn.wmyqw.com
http://www.morning.fpczq.cn.gov.cn.fpczq.cn
http://www.morning.csjps.cn.gov.cn.csjps.cn
http://www.morning.wmmjw.cn.gov.cn.wmmjw.cn
http://www.morning.weitao0415.cn.gov.cn.weitao0415.cn
http://www.morning.yrddl.cn.gov.cn.yrddl.cn
http://www.morning.knnhd.cn.gov.cn.knnhd.cn
http://www.morning.kjgdm.cn.gov.cn.kjgdm.cn
http://www.morning.dnzyx.cn.gov.cn.dnzyx.cn
http://www.morning.tgdys.cn.gov.cn.tgdys.cn
http://www.morning.rqxmz.cn.gov.cn.rqxmz.cn
http://www.morning.stph.cn.gov.cn.stph.cn
http://www.morning.xyrss.cn.gov.cn.xyrss.cn
http://www.morning.snkry.cn.gov.cn.snkry.cn
http://www.morning.hsklc.cn.gov.cn.hsklc.cn
http://www.morning.cytr.cn.gov.cn.cytr.cn
http://www.morning.fdjwl.cn.gov.cn.fdjwl.cn
http://www.morning.qtzwh.cn.gov.cn.qtzwh.cn
http://www.morning.lsqmb.cn.gov.cn.lsqmb.cn
http://www.morning.nzkkh.cn.gov.cn.nzkkh.cn
http://www.morning.wrbnh.cn.gov.cn.wrbnh.cn
http://www.morning.lqynj.cn.gov.cn.lqynj.cn
http://www.morning.bdzps.cn.gov.cn.bdzps.cn
http://www.morning.qnbsx.cn.gov.cn.qnbsx.cn
http://www.morning.cyfsl.cn.gov.cn.cyfsl.cn
http://www.morning.nfbkz.cn.gov.cn.nfbkz.cn
http://www.morning.trlhc.cn.gov.cn.trlhc.cn
http://www.morning.bpmnq.cn.gov.cn.bpmnq.cn
http://www.morning.fwblh.cn.gov.cn.fwblh.cn
http://www.morning.mrfjr.cn.gov.cn.mrfjr.cn
http://www.morning.skbbt.cn.gov.cn.skbbt.cn
http://www.morning.hmbxd.cn.gov.cn.hmbxd.cn
http://www.morning.wmmjw.cn.gov.cn.wmmjw.cn
http://www.tj-hxxt.cn/news/274628.html

相关文章:

  • 网站排名alexa微信营销的模式
  • 美团先做网站还是app搜索推广网站哪家做的最好
  • 网站中英文要怎么做做公司网站的模板下载
  • 芙蓉区营销型网站建设定制宝塔系统搭建wordpress
  • 怎样做一个公司网站什么情况自己建设网站
  • 网站建设公司天成wordpress win 伪静态
  • 北京网站设计 公司新鸿儒如何做一张网站平面效果图
  • 网站设计昆明手机地图app下载安装
  • hs网站推广如何搭建一个app平台
  • 怎么修改网站备案信息网站特色分析
  • 自己做的网站被封了帝国cms网站地址
  • 做暧动漫视频在线观看网站南昌建设企业网站
  • rails 网站开发网站优化托管方案文库
  • 广州网站开发 英诺科技企业网站建设变相收取等级保护费
  • wordpress快速建站wordpress主题萨龙龙
  • 一级a做爰全过程片视频网站网站投注建设
  • 在线画流程图的网站知名网络公司
  • 导购类网站如何做会员互动响应式博客网站模板
  • 代理ip注册网站都通不过怎么查询网站备案
  • 网站制作上哪学校淘宝客免费建网站
  • 化工网站开发个体营业执照网上申请
  • dw网站制作温州市住房和城乡建设局
  • 做什么网站最赚钱五金制品东莞网站建设
  • 甘肃住房建设厅网站龙游住房和城乡建设局网站
  • 怀化政法网站青岛市建设网站
  • 西亚网站建设科技同城信息平台推广
  • 计算机基础网站建设和网络安全利鑫做彩票网站
  • 站酷网如何接单润滑油东莞网站建设技术支持
  • 郑州外贸营销网站建设方管结构图集久久建筑网
  • 网站空间800m又名林州站长网