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...

类似判断 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)); ...

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

public static string a(string s) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.Length; i++) { int t=Convert.ToInt32(s[i]); if (t>= 48 &&t

string aa=Console.ReadLine(); char[] bb=aa.ToCharArry(); for(int i=bb.length-1;i>=0;i--) { Console.Write(bb[i]); } 纯手写,不知道有错没,没编译没调试

static void Main(string[] args) { Console.WriteLine("请输入n:"); String strInput = Console.ReadLine(); int n = Convert.ToInt32(strInput); //创建用于产生随机数的Random类 Random rd = new Random(); for (int k = 0; k < n; k++) { i...

using System;class Example{static void Main(){const int July = 7;const int Feb = 2;int daysInJuly = System.DateTime.DaysInMonth(2001, July); Console.WriteLine(daysInJuly);// daysInFeb gets 28 because the year 1998 was not a lea...

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