![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
有人跟我一样懒
...
展开
-
求水仙花数
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace p1{ class Program { static void Main(string[] args) { int a=0,b=0,原创 2014-09-04 21:52:33 · 1039 阅读 · 0 评论 -
将字符串倒序
.继续在该类中编写一下方法,名称为Reconvert,参数一个,但可以是字符串、整数、单精度、双精度,方法功能返回参数的逆序。如Reconvert(6221982)返回值为2891226。提示:将string转换为Char char[] c=strS.ToCharArray()using System;using System.Collections.Generic;usi原创 2014-09-28 22:51:59 · 865 阅读 · 0 评论 -
求参数出现的次数
编写一个名称为MyClass一个类,在该类中编写一个方法,名称为CountChar,返回值为整型,参数两个,第一个参数可以是字符串、整数、单精度、双精度,第二个参数为字符,方法功能返回第二个参数在第一个参数中出现次数。如CountChar("6221982",'2')返回值为3。using System;using System.Collections.Generic;using Sys原创 2014-09-28 22:49:42 · 907 阅读 · 0 评论 -
输出随机数1到511*511序列
编写一个控制台应用,实现输出一个从1开始到511*511长度的随机数序列。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace RAndom{ class Program { static void Main(string.........原创 2014-09-28 23:02:19 · 1172 阅读 · 0 评论 -
猜数字游戏
********5.随机给出一个0至99(包括0和99)之间的数字,然后让你猜是什么数字。你可以随便猜一个数字,游戏会提示太大还是太小,从而缩小结果范围。经过几次猜测与提示后,最终推出答案。 提示:用Random类的Next方法产生数据using System;using System.Collections.Generic;using System.Linq;using Syst原创 2014-09-28 22:56:41 · 985 阅读 · 0 评论 -
计算物体密度
编写C#控制台应用程序,对第2题进行扩展,从PhysicalObject中派生出移动物体类MovingObject,在其中增加物体的速度信息,并实现物体动量和动能的计算。 提示:动量计算公式p=m*v(物体质量*速度) 动能计算公式p=m*v*v/2using System;using System.Collections.Generic;using System.........原创 2014-09-28 23:00:37 · 1096 阅读 · 0 评论 -
判断是否为回文数+求一个序列的第30个数
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace _11111{ class Program { static void Main(string[] args) { string c原创 2014-09-04 21:56:16 · 851 阅读 · 0 评论 -
输入学号和姓名,对不存在的学号加到hashtable类的实例中,对存在学号给出提示
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace ConsoleApplication1{ class Program { static void M原创 2014-09-18 09:25:20 · 1559 阅读 · 0 评论 -
判断字符串中A出现的个数,及单词的个数
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Stringing{ class Program { static void Main(string[] args) {原创 2014-09-18 08:40:47 · 1452 阅读 · 0 评论 -
判断是否为闰年
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace qqqqqq{ class Program { static void Main(string[] args) {原创 2014-09-04 21:58:16 · 764 阅读 · 0 评论 -
字符串的各种操作
3.编写一个控制台应用。输入一组整数,输出所有的奇数。 提示:使用字符串的Split函数4.输入一个由若干字符组成的字符串,输出其中的大写字母、小写字母、数字和其他字符的个数。 提示:使用ToCharArray函数using System;using System.Collections.Generic;using System.Linq;using System.Text;原创 2014-09-28 22:54:30 · 768 阅读 · 0 评论