snrg.net
当前位置:首页 >> C#练习: 编写一个控制台应用程序,它接受用户输入... >>

C#练习: 编写一个控制台应用程序,它接受用户输入...

static void Main(string[] args) { Console.Write("请输入字符串:"); string str = Console.ReadLine(); for (int i = str.Length-1; i >= 0; i--) { Console.Write(str[i]); } }

using System;using System.Collections.Generic;using System.Text;using System.Data.OleDb;using System.Data;using System.Text.RegularExpressions;namespace Demo6{ class Program { static void Main(string[] args) { Console.WriteLine...

for(int i=0;i

类似判断 if (Convert.ToInt32('A') >= 65 && Convert.ToInt32('A')

代码较简单,就不注释了,有不懂的话再问,满意的话就采纳了吧! using System;namespace test{ class Program { static void Main(string[] args) { Console.Write("请输入一个字母:"); char c = (char)Console.Read(); if (Char.IsLetter(c))...

Console.Write("请输入一个字符串:"); string str = Console.ReadLine(); int count = 0; foreach (char c in str) { if (char.IsLetter(c)) { count ++; } } Console.WriteLine(string.Format("字符串{0}中字母的个数为:{1}", str, count)); ...

需要的话 留邮箱 后面可以发给你

如果是C#的话真不用那么麻烦 VS有直接的控件可以使用

static void Main(string[] args) { string str = "ss1zb5cz3ve63wA9"; var strb = new StringBuilder(); foreach (var ch in str) { if (char.IsDigit(ch)) strb.Append('$'); strb.Append(ch); } Console.WriteLine("结果:{0}", strb.ToStrin...

public int[] GetFactors(int n){ int Count = 0; int[] temp = new int[n]; for(int i = 1; i < n; i++){ if (n % i == 0) { temp [Count] = i; Count++; } } int[] OutFactors = new int[Count]; for (int i = 0; i < OutFactors.Length; i++)...

网站首页 | 网站地图
All rights reserved Powered by www.snrg.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com