YTU
和你熟
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
YTU OJ 3493 问题 A: FileStream读文件
YTU OJ 3493 问题 A: FileStream读文件很多小伙子是不是做这题直接Console.WriteLine()打印样例输出蒙混过关?也应该有很多找不到myFile.dic这个文件,我一开始以为是取的文件路径出了问题,后来发现,原来oj根本没有这个文件。不能靠打印混过去,那只能自己创建一个myFile.dic了using System;using System.Collections.Generic;using System.Linq;using System.Text;u原创 2021-05-13 19:38:26 · 385 阅读 · 1 评论 -
YTU OJ C# 1903: 有假币
YTU OJ C# 1903: 有假币using System;class A{ static void Main(String[] args) { double i; while ((i = Convert.ToInt32(Console.ReadLine())) != 0) { var num = 0; while (i>3) {原创 2021-04-11 20:30:30 · 144 阅读 · 0 评论 -
YTU OJ 3485 问题 D: 接口实例(C#,IShape)
YTU OJ 3485 问题 D: 接口实例(C#,IShape)using System;namespace Myinterface{ public interface IShape { double Perimeter(); double Area(); } class Circle : IShape { public double Radius { get; set; } public Ci原创 2021-04-08 21:24:38 · 216 阅读 · 0 评论 -
YTU OJ 3453 问题 A: c#简单类的继承
YTU OJ 3453 问题 A: c#简单类的继承using System;namespace ConsoleApplication1{ abstract class Bird { public abstract void Eat(); } class Mapie : Bird { public override void Eat() { Console.WriteLine("Map原创 2021-04-07 17:29:40 · 186 阅读 · 0 评论 -
YTU OJ 3491 问题 A: C#抽象类Vehicles
YTU OJ 3491 问题 A: C#抽象类Vehicles题目描述一、定义一个抽象类Vehicles,具体要求如下:1、私有字段商标brand(string)、颜色color(string)。2、定义公有读写属性Brand用来访问brand字段;定义公有读写属性Color用来访问color字段。3、设计一个抽象虚方法run()。二、定义Vehicles类的子类Car,具体要求如下:1、私有字段载重load(double)。2、定义公有读写属性Load用来访问load字段。3、重写抽象方原创 2021-04-07 16:46:07 · 311 阅读 · 0 评论 -
YTU OJ 1935 C语言合法标识符 C#
YTU OJ 1935 C语言合法标识符 C#using System;class Program{ static void Main(String[] agrs) { var a = Convert.ToInt32(Console.ReadLine()); for (var i = 0; i < a; i++) { var str1 = Console.ReadLine(); if原创 2021-04-02 23:00:33 · 223 阅读 · 0 评论 -
YTU OJ 3446 问题 E: C#统计字符出现的个数
YTU OJ 3446 问题 E: C#统计字符出现的个数using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ class Program { static void Main(string[] args) {原创 2021-03-31 22:35:17 · 283 阅读 · 1 评论 -
YTU OJ 3451 问题 D: c#随机数的产生与输出
YTU OJ 3451 问题 D: c#随机数的产生与输出using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ class Program { static void Main(string[] args) {原创 2021-03-31 21:40:09 · 151 阅读 · 0 评论 -
YTU OJ 3445 问题 C: c#统计字符串中数字字符的个数
YTU OJ 3445 问题 C: c#统计字符串中数字字符的个数using System;class Program{ static void Main(string[] args) { Getnumber(Console.ReadLine()); } static void Getnumber(string strsource) { var num = 0; for (var i = 0; i < st原创 2021-03-31 21:30:15 · 379 阅读 · 0 评论 -
YTU OJ 3454 问题 B: C#组成考题字符串
YTU OJ 3454 问题 B: C#组成考题字符串using System;class Program{ static void Main(string[] args) { arrayKT(Convert.ToInt32(Console.ReadLine())); } static void arrayKT(int a) { var tomp = 0; var str = (Console.ReadLine(原创 2021-03-31 21:16:03 · 195 阅读 · 0 评论 -
YTU OJ 3486 问题 A: 简单类及成员实例(C#)
YTU OJ 3486 问题 A: 简单类及成员实例(C#)using System;namespace sample{ class Student { public string studentid;//学号 public string studentname;//姓名 private string birthplace;//籍贯 private DateTime birthdate;//出生日期 //////原创 2021-03-30 22:47:56 · 228 阅读 · 0 评论 -
YTU OJ C# 3505: 魔力变变变
YTU OJ C# 3505: 魔力变变变using System;class Program{ static void Main(String[] args) { var str = Console.ReadLine(); Console.WriteLine(str.Substring(3)+ str.Substring(0, 3)); } }原创 2021-03-27 20:13:40 · 115 阅读 · 0 评论 -
YTU OJ C# 3437: 小豪要增重
YTU OJ C# 3437: 小豪要增重using System;class Program{ static void Main(String[] args) { var str1 = (Console.ReadLine()).Split(' '); var a = Convert.ToInt32(str1[0]); var b = Convert.ToInt32(str1[1]); var year = 0;原创 2021-03-27 19:27:15 · 189 阅读 · 0 评论 -
YTU OJ C# 3433: 小琰喝汽水
YTU OJ C# 3433: 小琰喝汽水using System;class Program{ static void Main(String[] args) { var n = 0; while((n=Convert.ToInt32(Console.ReadLine()))!=0) { var bottle = 0; var NewBottle = 0; w原创 2021-03-27 18:54:32 · 138 阅读 · 0 评论 -
YTU OJ 2448: 分离正整数中的各位数
YTU OJ 2448: 分离正整数中的各位数贺老师爱挖坑啊,题干说输入是用空格隔开的正整数,但是OJ有一组测试数据是输入一行数据后回车再输入一行。using System;class Program{ static void Main(string[] args) { string str; while (String.IsNullOrEmpty(str = Console.ReadLine())==false) {//检测是否有原创 2021-03-25 16:44:49 · 182 阅读 · 0 评论 -
YTU OJ C# 1637: List the Books
YTU OJ C# 1637: List the Books题目描述Jim is fond of reading books, and he has so many books that sometimes it’s hard for him to manage them. So he is asking for your help to solve this problem. Only interest in the name, press year and price of the book, Ji原创 2021-03-24 21:18:49 · 122 阅读 · 0 评论 -
YTU OJ C# 1636: FatMouse‘ Trade
YTU OJ C# 1636: FatMouse’ Tradeusing System;class Program{ static void Main(String[] agrs) { string num; string[] str; var M = 0; var N = 0; method method = new method(); while (String.IsNullOrEmp原创 2021-03-24 17:38:27 · 200 阅读 · 2 评论 -
YTU OJ 1617: Quicksum
YTU OJ 1617: Quicksumusing System;class Program{ static void Main(String[] agrs) { string num; method method = new method(); while (String.IsNullOrEmpty(num = Console.ReadLine()) == false) { char[] st原创 2021-03-23 21:02:20 · 183 阅读 · 1 评论 -
YTU OJ C# 1616: 01串排序
YTU OJ C# 1616: 01串排序using System;class Program{ static void Main(String[] agrs) { string[] num =new string[100]; var i = 0; method method = new method(); while (String.IsNullOrEmpty(num[i] = Console.ReadLine())原创 2021-03-23 19:58:50 · 695 阅读 · 1 评论 -
YTU OJ 1606: 对称三位数素数
YTU OJ 1606: 对称三位数素数using System;class Program{ static void Main(String[] agrs) { string num; method method = new method(); while (String.IsNullOrEmpty(num = Console.ReadLine()) == false) { method.shu原创 2021-03-23 11:10:45 · 277 阅读 · 0 评论 -
YTU OJ 1098: The 3n + 1 problem
YTU OJ 1098: The 3n + 1 problemusing System;class Program{ static void Main(String[] agrs) { string num; method method = new method(); while (String.IsNullOrEmpty(num = Console.ReadLine()) == false) {原创 2021-03-22 22:58:12 · 137 阅读 · 0 评论 -
YTU OJ 1091: A+B for Input-Output Practice (IV)
YTU OJ 1091: A+B for Input-Output Practice (IV)using System;class Program{ static void Main(string[] args) { method method1 = new method(); while (method1.judge()!="0") { method1.cal(); }原创 2021-03-22 17:37:29 · 187 阅读 · 0 评论 -
YTU OJ 1094: A+B for Input-Output Practice (VII)
YTU OJ 1094: A+B for Input-Output Practice (VII)using System;class Program{ static void Main(string[] args) { string num; var a = 0; var b = 0; while(String.IsNullOrEmpty(num = Console.ReadLine())==false)原创 2021-03-22 16:50:41 · 124 阅读 · 0 评论 -
YTU OJ 3490 C# 问题 A: C# teacher类
YTU OJ 3490 C# 问题 A: C# teacher类题目描述定义一个教师类Teacher,具体要求如下:1、私有字段工号no(string)、姓名name(string)、出生日期birthday(DateTime)、性别sex(SexFlag)。其中,SexFlag为枚举类型,包括Male(表示男性)、Female(表示女性),并且字段sex缺省值为男。2、定义公有读写属性No用来访问no字段;定义公有读写属性Name用来访问name字段;定义公有只写属性Birthday用来赋值bir原创 2021-03-21 14:34:17 · 384 阅读 · 4 评论 -
YTU OJ 3452 C# 问题 E: C#判断回文字符串
YTU OJ 3452 C# 问题 E: C#判断回文字符串using System;using System.Text;namespace text1{ class Program { static void Main(String[] args) { Method(Console.ReadLine()); } static string Method(string str)原创 2021-03-18 21:34:19 · 177 阅读 · 0 评论 -
YTU OJ 3447 C# 问题 D: C#解密出生日期
YTU OJ 3447 C# 问题 D: C#解密出生日期using System;namespace text1{ class Program { static void Main(String[] args) { Method(Console.ReadLine()); } static string Method(string str) { Date原创 2021-03-18 17:50:29 · 218 阅读 · 0 评论 -
YTU OJ 3444 C# 问题 C: C#提取文件名
YTU OJ 3444 C# 问题 C: C#提取文件名using System;namespace text1{ class Program { static void Main(string[] args) { Location(Console.ReadLine()); } public static string Location(string str) {原创 2021-03-18 16:19:05 · 356 阅读 · 0 评论 -
YTU OJ 1633 C# 问题 F: 水仙花数
YTU OJ 1633 问题 F: 水仙花数using System;class panduan{ public int suixianhuashu(int m, int n) { int i = 0; for (int a = m; a <= n; a++) { int z = a % 10; int y = (a % 100 - z) / 10; int原创 2021-03-14 18:04:25 · 270 阅读 · 2 评论 -
YTU OJ C# 问题D:歌手的分数
YTU OJ 问题D:歌手的分数要注意这里输入并不是分开输入的,也没说明,坑人!using System;class Program{ static void Main(string[] args) { double average = 0; string str=Console.ReadLine(); string[] str1 = str.Split(' ');//以空格为分割符分割字符串,并存入数组 int原创 2021-03-13 18:12:19 · 299 阅读 · 0 评论 -
YTU OJ 1966 数列求和
1966: 数列求和时间限制: 1 Sec 内存限制: 4 MB题目描述:数列求和是一类常见的问题,本题有一定的代表性: 求s=a+aa+aaa+aaaa+……+aa…aa(n位); 其中a的值由键盘输入,位数n也由键盘输入;输入:第一行输入a的值; 第二行输入位数n;输出:输出对n个数完成求和运算后的结果; 比如a=3,n=6时,s=3+33+333+3333+33333+333...原创 2019-04-17 22:31:34 · 343 阅读 · 0 评论 -
YTU OJ 1937 查找最大元素
问题 D: 查找最大元素时间限制: 1 Sec 内存限制: 64 MB题目描述对于输入的每个字符串,查找其中的最大字母,在该字母后面插入字符串“(max)”。输入输入数据包括多个测试实例,每个实例由一行长度不超过100的字符串组成,字符串仅由大小写字母构成。输出对于每个测试实例输出一行字符串,输出的结果是插入字符串“(max)”后的结果,如果存在多个最大的字母,就在每一个最大字母后...原创 2019-04-08 10:12:05 · 463 阅读 · 0 评论 -
YTU OJ 3385 小胖学长山洞探险
3385: 小胖学长山洞探险时间限制: 1 Sec 内存限制: 128 MB题目描述现在有一个nm的形似二维数组的山洞。出口就在数组中最大的数值处,你能帮小胖找到出口么?输入输入一个nm的二维数组,寻找数组中最大的值第一行 n m (1<=n,m<=10)后面n行,每行m个数据。构成二维数组输出最大值样例输入4 41 2 3 45 6 7 98 10 1...原创 2019-03-30 23:23:08 · 738 阅读 · 0 评论 -
YTU OJ 3489 C#异或运算符的使用
YTU3489C#异或运算符的使用看到题目很多人都会想直接使用int num = Convert.ToInt32(Console.WriteLine)读取输入的数;但是事情往往没有这么简单,直接使用 Convert.ToInt32()没有考虑到如果输入的是String类型就会转换失败并抛出异常:System.FormatException:“Input string was not in a correct format.”这时候我们就需要用到int.TryParse()方法来检测转换是否可以进原创 2021-03-10 22:08:38 · 1421 阅读 · 4 评论
分享