diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\200\346\254\241\344\275\234\344\270\232/hellow word.PNG" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\200\346\254\241\344\275\234\344\270\232/hellow word.PNG" new file mode 100644 index 0000000000000000000000000000000000000000..d71a7283221ed3e0ebc75dd3bb0ed16073dfb182 Binary files /dev/null and "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\200\346\254\241\344\275\234\344\270\232/hellow word.PNG" differ diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\200\346\254\241\344\275\234\344\270\232/hellow word.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\200\346\254\241\344\275\234\344\270\232/hellow word.cs" new file mode 100644 index 0000000000000000000000000000000000000000..a864fc4b52941880d0e34017e01584076f69b8d8 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\200\346\254\241\344\275\234\344\270\232/hellow word.cs" @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp1 +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello Word!"); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\245\277\346\270\270\350\256\260.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\245\277\346\270\270\350\256\260.cs" new file mode 100644 index 0000000000000000000000000000000000000000..0c816947eab67e9a2a4df346a8b07a5423de5408 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\245\277\346\270\270\350\256\260.cs" @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class Program + { + static void Main(string[] args) + { + Student.Teacher = "唐僧"; + + Student student1 = new Student("孙悟空"); + Student student2 = new Student("猪八戒"); + Student student3 = new Student("沙和尚"); + Student student4 = new Student("白龙马"); + Student student5 = new Student("潮涌"); + + student1.PrintInfo(); + student2.PrintInfo(); + student3.PrintInfo(); + student4.PrintInfo(); + student5.PrintInfo(); + + + Student.Teacher = "嫦娥姐姐"; + + student1.PrintInfo(); + student2.PrintInfo(); + student3.PrintInfo(); + student4.PrintInfo(); + student5.PrintInfo(); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\245\277\346\270\270\350\256\2602.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\245\277\346\270\270\350\256\2602.cs" new file mode 100644 index 0000000000000000000000000000000000000000..fa882b5d65cc515819ed59e093a600319e515731 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\245\277\346\270\270\350\256\2602.cs" @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class d5 + { + public string Name { get; set; } + + public static string Teacher { get; set; } + + + public d5(string name) + { + this.Name = name; + + } + + public void Print() + { + Console.WriteLine($"大家好,我是{Name},俺老师是{Teacher}"); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\211\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2723.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\211\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2723.cs" new file mode 100644 index 0000000000000000000000000000000000000000..cca4357dbcd5fe66d987230677b654024f67d0a6 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\270\211\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2723.cs" @@ -0,0 +1,252 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zb +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("请输入圆的半径:"); + double r = Convert.ToDouble(Console.ReadLine()); + Console.WriteLine("圆的面积是:" + (3.14 * r * r)); + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入一个四位数"); + int i = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("千位数:" + (i / 1000) + "百位数:" + (i % 1000 / 100) + "十位数:" + (i % 100 / 10) + "个位数" + (i % 10)); + Console.WriteLine(); + + /*---------------------------------------------*/ + + int i1, i2, i3; + Console.WriteLine("请输入三个数"); + i1 = Convert.ToInt32(Console.ReadLine()); + i2 = Convert.ToInt32(Console.ReadLine()); + i3 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("最大的数是:" + ((i1 > i2 ? i1 : i2) > i3 ? (i1 > i2 ? i1 : i2) : i3)); + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入一个数"); + i = 1; + for (int x = Convert.ToInt32(Console.ReadLine()); x > 0; x--) + { + i = i * x; + } + Console.WriteLine("它的乘阶是:" + i); + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入一个数"); + i = 1; i1 = 0; + for (int x = Convert.ToInt32(Console.ReadLine()); x > 0; x--) + { + for (int x1 = x; x1 > 0; x1--) + { + i = i * x1; + } + i1 = i1 + i; + i = 1; + } + Console.WriteLine("它所有的乘阶和是:" + i1); + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入边长"); + int y = Convert.ToInt32(Console.ReadLine()); + for (i = 1; i <= y; i++) + { + for (int j = 1; j <= y - i; j++) + { + Console.Write(" "); + } + for (int k = 1; k <= 2 * i - 1; k++) + { + Console.Write("*"); + } + Console.WriteLine(); + } + for (i = y - 1; i >= 1; i--) + { + for (int j = 1; j <= y - i; j++) + { + Console.Write(" "); + } + for (int k = 1; k <= 2 * i - 1; k++) + { + Console.Write("*"); + } + Console.WriteLine(); + } + Console.WriteLine(); + /*---------------------------------------------*/ + + int[,] a = { { 1, 1 }, { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, + { 6, 6 }, { 7,7},{8,8},{9,9}}; + for (i = 0; i <= 8; i++) + { + for (int j = 0; j <= i; j++) + { + Console.Write(a[j, 1] + "*" + a[i, 1] + "=" + (a[j, 1] * a[i, 1]) + " "); + if (j == 1 && (i == 3 || i == 2)) { Console.Write(" "); } + } + Console.WriteLine(); + } + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入一串字符"); + i3 = 0; i1 = 0; i2 = 0; + string s = Console.ReadLine(); + char[] c = s.ToCharArray(); + int i4 = s.Length; + for (i = 0; i < i4; i++) + { + if (c[i] >= '0' && c[i] <= '9') { i1++; } + else if (c[i] >= 'a' && c[i] <= 'z' || c[i] >= 'A' && c[i] <= 'Z') { i2++; } + else { i3++; } + } + Console.WriteLine($"输入的字符有{i1}个数字,{i2}个字母,{i3}其他字符"); + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入五个学生的成绩"); + double[] cj = new double[5]; double c1 = 0; + for (i = 0; i <= 4; i++) + { + cj[i] = Convert.ToDouble(Console.ReadLine()); + c1 = c1 + cj[i]; + } + Console.WriteLine("五位同学的平均成绩为" + (c1 / 5.0)); + Console.WriteLine(); + + /*---------------------------------------------*/ + + int[] b = { 1, 3, 56, 12, 34, 2 }; + for (i = 0; i < b.Length; i++) + { + bool m = false; + for (i1 = 0; i1 < b.Length - 1; i1++) + { + if (b[i1] > b[i1 + 1]) + { + m = true; + i2 = b[i1]; + b[i1] = b[i1 + 1]; + b[i1 + 1] = i2; + } + } + if (!m) { break; } + } + for (i = 0; i < b.Length; i++) + { + Console.Write($"{b[i]} "); + } + Console.WriteLine(); + Console.WriteLine(); + + + /*---------------------------------------------*/ + + + for (i = 0; i < b.Length; i++) + { + Console.Write($"{b[i]} "); + } + Console.WriteLine("请输入要查询的数"); + i = Convert.ToInt32(Console.ReadLine()); + for (i1 = 0; i1 < b.Length; i1++) + { + if (i == b[i1]) + { + Console.WriteLine("它的下标为" + i1); + } + } + Console.WriteLine(); + + /*---------------------------------------------*/ + + for (i = 0; i < b.Length; i++) + { + Console.Write($"{b[i]} "); + } + Console.WriteLine(); + Console.Write("其中偶数是"); + for (i1 = 0; i1 < b.Length; i1++) + { + if (b[i1] % 2 == 0) + { + Console.Write(i1 + " "); + } + } + Console.WriteLine(); + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入正方形的边长"); + i = Convert.ToInt32(Console.ReadLine()); + for (i1 = 1; i1 <= i; i1++) + { + for (i2 = 1; i2 <= i; i2++) + { + Console.Write("* "); + } + Console.WriteLine(); + } + Console.WriteLine(); + + /*---------------------------------------------*/ + + Console.WriteLine("请输入正方形的边长"); + i = Convert.ToInt32(Console.ReadLine()); + for (i1 = 1; i1 <= i; i1++) + { + for (i2 = 1; i2 <= i; i2++) + { + if (i1 == 1 || i1 == i) + { + Console.Write("* "); + } + else if (i2 == 1 || i2 == i) + { + Console.Write("* "); + } + else { Console.Write(" "); } + } + Console.WriteLine(); + } + Console.WriteLine(); + + /*---------------------------------------------*/ + + int[,] array = new int[10, 10]; + for (i = 0; i < 10; i++) + { + for (int j = 0; j <= i; j++) + { + if (j == 0 || i == j) + { + array[i, j] = 1; + } + else + { + array[i, j] = array[i - 1, j - 1] + array[i - 1, j]; + } + Console.Write(array[i, j].ToString() + " "); + } + Console.WriteLine(); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2721.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2721.cs" new file mode 100644 index 0000000000000000000000000000000000000000..03b37731b17be0b6ea8d6355c89a8e8a7c09051d --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2721.cs" @@ -0,0 +1,69 @@ +using System; + +namespace 基础语法 +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("真是天上降魔主"); + Console.WriteLine("如同人间太岁神"); + Console.WriteLine("这个贾克斯"); + Console.WriteLine("牛"); + Console.WriteLine("逼"); + Console.WriteLine("--------------------"); + bool s1=true; + bool s2=false; + Console.WriteLine("s1"+s1); + Console.WriteLine("s2"+s2); + Console.WriteLine("--------------------"); + byte a1 = 0; + byte a2 = 255; + Console.WriteLine("a1"+a1); + Console.WriteLine("a2"+a2); + short b1 = 3; + short b2 = 4; + Console.WriteLine("b1"+b1); + Console.WriteLine("b2"+b2); + int c1 = 5; + int c2 = 6; + Console.WriteLine("c1"+c1); + Console.WriteLine("c2"+c2); + long d1 = 7; + long d2 = 8; + Console.WriteLine("d1"+d1); + Console.WriteLine("d2"+d2); + Console.WriteLine("--------------------"); + float e1 = -3.14f; + float e2 = 3.14f; + Console.WriteLine("e1"+e1); + Console.WriteLine("e2"+e2); + double f1 = -3.14; + double f2 = 3.14; + Console.WriteLine("f1"+f1); + Console.WriteLine("f2"+f2); + Console.WriteLine("--------------------"); + int a = 10; + int b = 20; + Console.WriteLine("a:" + a); + Console.WriteLine("b" + b); + int temp = a; + a = b; + b = temp; + Console.WriteLine("a"+a); + Console.WriteLine("b"+b); + Console.WriteLine("-------------------"); + int x = 100, y = 200; + int add = x + y; + int sub = x - y; + int mul = x * y; + int div=x / y; + Console.WriteLine("-------------------"); + double x1 = 100.8, y1 = 20.6; + double add1 = x1 + y1; + double sub1= x1 - y1; + double mul1 = x * y1; + double div1 = x / y1; + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2722.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2722.cs" new file mode 100644 index 0000000000000000000000000000000000000000..4163e232b45f8711137da194eba04efe686f6d3d --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\214\346\254\241\344\275\234\344\270\232/\345\237\272\347\241\200\350\257\255\346\263\225\345\267\251\345\233\2722.cs" @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace lx1 +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("请输入一个字符:"); + int a1=Convert.ToInt32(Console.ReadLine()); + if (a1>=0&&a1<=9) + { + Console.WriteLine("该字符为数字字符"); + } + else + { + Console.WriteLine("该字符不是数字字符"); + } + + Console.WriteLine("请输入一个字符:"); + char a2=char.Parse(Console.ReadLine()); + if ((a2 >= 'A' && a2 <='Z')||(a2>='a' && a2<='z')) + { + Console.WriteLine("该字符是字母字符"); + } + else + { + Console.WriteLine("该字母不是字母字符"); + } + + Console.WriteLine("输入年份:"); + int a3=Int32.Parse(Console.ReadLine()); + if ((a3 %4==0 && a3% 100!=0)||(a3 %400==0)) + { + Console.WriteLine("该年份为闰年"); + } + else + { + Console.WriteLine("该年份不是闰年"); + } + + Console.WriteLine("请输入三位数字"); + int a4=Convert.ToInt32(Console.ReadLine()); + int b1=a4/100; + int b2=a4/10%10; + int b3=a4%10; + if (a4==(b1*b1*b1+b2*b2*b2+b3*b3*b3)) + { + Console.WriteLine($"{a4}是水仙花数"); + } + else + { + Console.WriteLine($"{a4}不是水仙花数"); + } + + Console.WriteLine("请输入一个五位数:"); + int a5=Convert.ToInt32(Console.ReadLine()); + int c1=a5/10000; + int c2=a5/1000%10; + int c3=a5/10%10; + int c4=a5%10; + if (c1==c4 && c2 ==c3) + { + Console.WriteLine($"{a5}是回文数"); + } + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Book.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Book.cs" new file mode 100644 index 0000000000000000000000000000000000000000..00d323469f2eeadbc979b12a3c0fb6eb8d7479d5 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Book.cs" @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace 第四次作业 +{ + internal class Book + { + private int id; + private string name; + private double price; + private string press; + + public int Id { get => id; set => id = value; } + public string Name { get => name; set => name = value; } + public double Price { get => price; set { if (price >= 0) { price = value; } else { price = 0;} } } + public string Press { get => press; set => press = value; } + + public void book() { + Console.WriteLine("书籍编号"+id); + Console.WriteLine("书籍名称"+name); + Console.WriteLine("书籍价格"+price); + Console.WriteLine("出版社"+press); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Program.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Program.cs" new file mode 100644 index 0000000000000000000000000000000000000000..86f8d6ffd4946dac0ddd3c14d4e0620060376434 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Program.cs" @@ -0,0 +1,37 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp1 +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("用户信息:"); + User user = new User(); + user.Id = 1; + user.name = "LOL"; + user.Password = "123456"; + user.Print(); + Console.WriteLine("学生信息"); + Student student = new Student(); + student.id = 1; + student.Name = "小张"; + student.Sex = '男'; + student.Age = 19; + student.Print(); + Console.WriteLine("书籍信息"); + Book book = new Book(); + book.id = 137; + book.name = "c#面向对象"; + book.Price = 39; + book.Press = "清华大学出版社"; + book.Print(); + Console.ReadKey(); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Student.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Student.cs" new file mode 100644 index 0000000000000000000000000000000000000000..3efbe6dfaac3a82a3037735a424f4adeea85d905 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/Student.cs" @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace 第四次作业 +{ + internal class Student + { + private int id; + private string name; + private int age; + private char sex; + + public int Id { get => id; set => id = value; } + public string Name { get => name; set => name = value; } + public int Age { get => age; set { if (age >= 0 && age <= 128) { age = value; } else { age = 0; } } } + public char Sex { get => sex; set => sex = value; } + + public void student() { + Console.WriteLine("编号:" + Id); + Console.WriteLine("姓名:" + Name); + Console.WriteLine("性别:" + Sex); + Console.WriteLine("年龄:" + Age); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/User.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/User.cs" new file mode 100644 index 0000000000000000000000000000000000000000..32cfdf49149df6d969ca5fccc4566e94223704d8 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\344\272\224\346\254\241\344\275\234\344\270\232/User.cs" @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace 第四次作业 +{ + internal class Class2 + { + public int id; + public string name; + public int password; + + public void Print() { + Console.WriteLine($"账号为{id}"); + Console.WriteLine($"用户名为{name}"); + Console.WriteLine($"密码为{password}"); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/school.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/school.cs" new file mode 100644 index 0000000000000000000000000000000000000000..3c5318df7f1c01ff72c8291c6d9417a72318b3bc --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/school.cs" @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class Program + { + static void Main(string[] args) + { + student student= new student(); + student.id = 1; + student.name = "张标"; + student.sex = '男'; + student.cardid = "123456"; + student.tel = 123456; + student.major = "软件技术"; + student.grade= 1; + + teacher teacher = new teacher(); + teacher.id = 2; + teacher.name = "谢老师"; + teacher.sex = '女'; + teacher.cardid = "2"; + teacher.tel= 3; + teacher.title = "职称"; + teacher.wageno = 1231; + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/student.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/student.cs" new file mode 100644 index 0000000000000000000000000000000000000000..046c16aa4946917dc34e52fddb510052155fc7b3 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/student.cs" @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class student + { + public int id { get; set; } + public string name { get; set; } + public char sex { get; set; } + public string cardid { get; set; } + public int tel { get; set; } + public string major { get; set; } + public int grade { get; set; } + + public void print () { + Console.WriteLine($"编号:{id}"); + Console.WriteLine($"姓名:{name}"); + Console.WriteLine($"性别:{sex}"); + Console.WriteLine($"身份证号:{cardid}"); + Console.WriteLine($"联系方式:{tel}"); + + Console.WriteLine($"专业:{major}"); + Console.WriteLine($"年级:{grade}"); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/teacher.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/teacher.cs" new file mode 100644 index 0000000000000000000000000000000000000000..7cb66e6dba2033ddc2637ab7cbea48578d731c68 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\345\255\246\347\224\237/teacher.cs" @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class teacher : student + { + public string title { get; set;} + public double wageno { get; set;} + + public void print() { + Console.WriteLine($"编号:{id}"); + Console.WriteLine($"姓名:{name}"); + Console.WriteLine($"性别:{sex}"); + Console.WriteLine($"身份证号:{cardid}"); + Console.WriteLine($"联系方式:{tel}"); + + Console.WriteLine($"职称:{title}"); + Console.WriteLine($"工资号:{wageno}"); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Erok.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Erok.cs" new file mode 100644 index 0000000000000000000000000000000000000000..8fc04046be8c10041f2defb5dc9be8233a4f2170 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Erok.cs" @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Program2 +{ + internal class Erok:heros + { + public void print() { + + base.print(); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Lucas.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Lucas.cs" new file mode 100644 index 0000000000000000000000000000000000000000..c85d546a15ffa6a5bd14a26b70ef9ace445d21a2 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Lucas.cs" @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Program2 +{ + internal class Lucas:heros + { + public void print() { + base.print(); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Program.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Program.cs" new file mode 100644 index 0000000000000000000000000000000000000000..611ae38c8956e8d502051d9e9cb3ab639200cfe7 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/Program.cs" @@ -0,0 +1,56 @@ +using System; + +namespace Program2 +{ + internal class Program + { + static void Main(string[] args) + { + System.Console.WriteLine("请输入你的大名:"); + string a = Console.ReadLine(); + + Erok erok= new Erok(); + erok.a= a; + erok.name = "埃洛克"; + erok.introduce = "埃洛克是一名极其痛恨牛头人的狂战士,他是爱情的捍卫者,是末日第一深情,是舔狗猎杀者。" + + "有关他的传说数不胜数,最为标志性的是他头上的牛角,那是某次不为人知的战斗战利品。" + + "倘若仔细看还能隐隐看到牛角盔下的盈盈绿光"; + erok.sobriquet = "纯爱战神"; + erok.ATK = 99.9; + erok.velocity = 66; + erok.defense = 66.6; + erok.skill1 = "纯爱打击"; + erok.skill2 = "绿光锚钩"; + erok.skill3 = "被牛咆哮"; + erok.print(); + + Thera thera = new Thera(); + thera.a = a; + thera.name = "泰拉"; + thera.introduce = "末日第一女拳家,对男性角色伤害超级加倍,引战速度极快,闻着味就来,是极强极其难缠的角色,但是极容易破防。"; + thera.sobriquet = "女拳斗士"; + thera.ATK = 999; + thera.velocity = 999; + thera.defense = 1; + thera.skill1 = "家人们,谁懂啊!"; + thera.skill2 = "权利掠夺"; + thera.skill3 = "责任抛弃"; + thera.print(); + + Lucas lucas=new Lucas(); + lucas.a = a; + lucas.name = "卢卡斯"; + lucas.introduce="落魄贵族卢卡斯,被斗X苍穹毒害的年轻一代。坚信三十年河东三十年河西,我命由我不由天,但是是个无业游民,至今还没找到自己的贴身老爷爷。"; + lucas.sobriquet = "消炎"; + lucas.ATK = 1; + lucas.velocity =99 ; + lucas.defense =99999; + lucas.skill1 = "莫欺少年穷"; + lucas.skill2 = "莫欺中年穷"; + lucas.skill3 = "莫欺老年穷"; + lucas.print(); + + + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/RPG.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/RPG.cs" new file mode 100644 index 0000000000000000000000000000000000000000..f018ca4fa925946a982d87de5f611963e1e2e74b --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/RPG.cs" @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Program2 +{ + internal class Thera:heros + { + public void print() { + base .print(); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/heros.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/heros.cs" new file mode 100644 index 0000000000000000000000000000000000000000..83d0aba54ce90c80f3e6d5698f4c7c4c6fc82c2b --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\253\346\254\241\344\275\234\344\270\232/\346\270\270\346\210\217/heros.cs" @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Program2 +{ + internal class heros + { + //角色名字,角色介绍,角色昵称,攻击力,防御力,速度 + public string a; + public string name { get; set; } + public string introduce { get; set; } + public string sobriquet { get; set; } + public double ATK { get; set; } + public double velocity { get; set; } + public double defense { get; set; } + + public string skill1 { get; set; } + public string skill2 { get; set; } + public string skill3 { get; set; } + + public void print(){ + Console.WriteLine($"阁下的大名:"+a); + Console.WriteLine($"名字:{name}"); + Console.WriteLine($"介绍:{introduce}"); + Console.WriteLine($"昵称:{sobriquet}"); + Console.WriteLine($"攻击:{ATK}"); + Console.WriteLine($"速度:{velocity}"); + Console.WriteLine($"防御:{defense}"); + Console.WriteLine($"技能;"+skill1+"\t"+skill2+"\t"+skill3); + } + + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class1.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class1.cs" new file mode 100644 index 0000000000000000000000000000000000000000..df034c00c5be60e0b8e0542584a815965435230c --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class1.cs" @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class Class1 + { + public static bool IsEmpty(int[] arr) + { + if (arr == null || arr.Length == 0) + { + return true; + } + else + { + return false; + } + } + + public static bool IsEmpty(double[] arr) + { + if (arr == null || arr.Length == 0) + { + return true; + } + else + { + return false; + } + } + public static bool IsEmpty(float[] arr) + { + if (arr == null || arr.Length == 0) + { + return true; + } + else + { + return false; + } + } + public static bool IsEmpty(string[] arr) + { + if (arr == null || arr.Length == 0) + { + return true; + } + else + { + return false; + } + } + public static bool IsEmpty(char[] arr) + { + if (arr == null || arr.Length == 0) + { + return true; + } + else + { + return false; + + } + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class2.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class2.cs" new file mode 100644 index 0000000000000000000000000000000000000000..6e95ada18686a47df57c9f2db2d2a856e0ec5420 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class2.cs" @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class Class2 + { + public static bool IsEmpty(string str) + { + if (str == null || str == "") + { + return false; + } + char[] chars = str.ToCharArray(); + for (int i = 0; i < chars.Length; i++) + { + if (chars[i] != ' ') + { + return false; + } + } + return true; + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class3.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class3.cs" new file mode 100644 index 0000000000000000000000000000000000000000..2a8345383d7e1d1d21fc2a3446935773982510d4 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232/Class3.cs" @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class Class3 + { + public static void S(double r, double g, double b) + { + double s = r * g * b; + Console.WriteLine("圆的面积:" + s); + } + public static void Rec(int x, int y) + { + int rec = x * y; + Console.WriteLine("长方形的面积:" + rec); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\200\346\254\241\344\275\234\344\270\232/\346\263\233\345\236\213\351\233\206\345\220\210/Program.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\200\346\254\241\344\275\234\344\270\232/\346\263\233\345\236\213\351\233\206\345\220\210/Program.cs" new file mode 100644 index 0000000000000000000000000000000000000000..8bdf336d24948e9e9993134be01cb88bcb146462 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\200\346\254\241\344\275\234\344\270\232/\346\263\233\345\236\213\351\233\206\345\220\210/Program.cs" @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp2 +{ + internal class Program + { + static void Main(string[] args) + { + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\200\346\254\241\344\275\234\344\270\232/\346\263\233\345\236\213\351\233\206\345\220\210/St.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\200\346\254\241\344\275\234\344\270\232/\346\263\233\345\236\213\351\233\206\345\220\210/St.cs" new file mode 100644 index 0000000000000000000000000000000000000000..840225e33de50585f0baec1cf5217b968be938a1 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\200\346\254\241\344\275\234\344\270\232/\346\263\233\345\236\213\351\233\206\345\220\210/St.cs" @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp2 +{ + internal class St + { + int id; + string name; + double chinese; + double math; + double english; + + public St(int id, string name, double chinese, double math, double english) + { + this.id = id; + this.name = name; + this.chinese = chinese; + this.math = math; + this.english = english; + } + + public St() { } + + public int Id { get => id; set => id = value; } + public string Name { get => name; set => name = value; } + public double Chinese { get => chinese; set => chinese = value; } + public double Math { get => math; set => math = value; } + public double English { get => english; set => english = value; } + + public override string ToString() + { + return $"{id}\t{name}\t{chinese}\t{math}\t{english}"; + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\211\346\254\241\344\275\234\344\270\232/\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237/Program.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\211\346\254\241\344\275\234\344\270\232/\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237/Program.cs" new file mode 100644 index 0000000000000000000000000000000000000000..6bf68f9c10d76fd3f062079e12c350319237f111 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\211\346\254\241\344\275\234\344\270\232/\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237/Program.cs" @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class Program + { + static void Main(string[] args) + { + static void Menu() + { + Console.WriteLine("1.增加图书信息"); + Console.WriteLine("2.删除图书信息"); + Console.WriteLine("3.修改图书信息"); + Console.WriteLine("4.查询图书信息"); + Console.WriteLine("5.退出"); + Console.WriteLine(".................."); + } + + + static void QueryMenu() + { + Console.WriteLine("1.查询所以图书信息"); + Console.WriteLine("2.按价查询图书信息"); + Console.WriteLine("3.按作者查询图书信息"); + Console.WriteLine("4.按编号查询巴拉巴拉"); + Console.WriteLine("5.退出"); + } + + public static void AddBook(Listlist) + { + book book = new book(); + Console.WriteLine("请输入图书编号"); + book.Id = Convert.ToInt32(Console.ReadLine()); + + Console.WriteLine("请输入图书名:"); + book.Name = Console.ReadLine(); + + Console.WriteLine("请输入图书价格:"); + book.Price = Convert.ToDouble(Console.ReadLine()); + + Console.WriteLine("请输入图书作者:"); + book.Author = Console.ReadLine(); + + list.Add(book); + Console.WriteLine("添加成功"); + } + + public static void RemoveBook(List list) + { + Console.WriteLine("请输入你要删除的图书的编号:"); + int id = Convert.ToInt32(Console.ReadLine()); + + for (int i = 0; i < list.Count; i++) + { + if (list[i].Id == id) + { + list.Remove(list[i]); + Console.WriteLine("删除成功"); + return; + } + } + Console.WriteLine("删除失败,找不到该图书"); + } + + + private static void Modify(List list) + { + Console.WriteLine("请输入要修改图书信息的编号:"); + int id = int.Parse(Console.ReadLine()); + foreach (book bookInfo in list) + { + if (bookInfo.Id == id) + { + Console.WriteLine("修改后的图书名:"); + string name = Console.ReadLine(); + Console.WriteLine("修改后的图书价格:"); + double price = double.Parse(Console.ReadLine()); + Console.WriteLine("修改后的图书作者信息:"); + string author = Console.ReadLine(); + Console.WriteLine("修改成功"); + return; + } + } + + } + + private static void QueryMenu(List list) + { + while (true) + { + QueryMenu(list); + Console.WriteLine("请输入你的选择:"); + int select = int.Parse(Console.ReadLine()); + switch (select) + { + case + printInfo(list); + break; + case + Console.WriteLine("请输入图书价格来查询:"); + double price = double.Parse(Console.ReadLine()); + priceTable(list, price); + break; + + case + Console.WriteLine("请输入要查找的图书的名字:"); + string name = Console.ReadLine(); + LikeName(list, name); + break; + case + Console.WriteLine("请输入要查找图书的编号:"); + int id = int.Parse(Console.ReadLine()); + IdPrint(list, id); + break; + case; + + break; + default: + Console.WriteLine("请重新输入"); + break; + } + if (select == 5) + { + break; + } + } + } + + private static void IdPrint(List list, int id) + { + foreach (book book in list) + { + if (book.Id == id) + Console.WriteLine("找到该图书"); + } + + } + + private static void priceTable(List list, double price) + { + foreach (book book list) + { + if (book.Price == price) + { + Console.WriteLine("找到了该图书"); + } + else + { + Console.WriteLine("不存在该图书"); + } + } + } + + private static void LikeName(List list, string? name) + { + foreach (book book in list) + { + if (book.Name == name) + { + Console.WriteLine(book); + } + } + } + + public static void Main(string[] args) + { + List list = new List(); + + while (true) + { + Menu(); + Console.WriteLine("请输入你的选择:"); + int select = int.Parse(Console.ReadLine()); + switch (select) + { + case + AddBook(list); + printInfo(list); + break; + + case + RemoveBook(list); + printInfo(list); + break; + + case + Modify(list); + printInfo(list); + break; + + case + QueryMenu(); + break; + + case + Environment.Exit(0); + break; + + default: + Console.WriteLine("选择错误,请重新输入"); + break; + } + } + + } + public static void printInfo(List list) + { + Console.WriteLine("图书编号\t图书名\t图书价格\t图书作者"); + + for (int i = 0; i < list.Count; i++) + { + Console.WriteLine(list[i]); + } + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\211\346\254\241\344\275\234\344\270\232/\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237/book.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\211\346\254\241\344\275\234\344\270\232/\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237/book.cs" new file mode 100644 index 0000000000000000000000000000000000000000..1175e22982efa0366fb242cc77a59fe754fb96a1 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\344\270\211\346\254\241\344\275\234\344\270\232/\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237/book.cs" @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace zbxa +{ + internal class book + { + int id; + string name; + double price; + string author; + + public int Id { get => id; set => id = value; } + public string Name { get => name; set => name = value; } + public double Price { get => price; set => price = value; } + public string Author { get => author; set => author = value; } + + public book() { } + public book(int id, string name, double price, string author) + { + Id = id; + Name = name; + Price = price; + Author = author; + } + + public override string ToString() + { + return $"{id}\t{name}\t{price}\t{author}"; + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/Calculate.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/Calculate.cs" new file mode 100644 index 0000000000000000000000000000000000000000..fab4a2f050b570feea81b3b64a9eebc3113e9f61 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/Calculate.cs" @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace duot +{ + internal class Calculate + { + protected int num1; + protected int num2; + protected Calculate(int num1,int num2) + { + this.num1 =num1; + this.num2 =num2; + } + public virtual void DisplayResult() { } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/Program.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/Program.cs" new file mode 100644 index 0000000000000000000000000000000000000000..6c2b1395abe4800da1ceec6f73ee4a188ee3722e --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/Program.cs" @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading.Tasks; + +namespace duot +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("请分别输入两个整数"); + int num1=Convert.ToInt32(Console.ReadLine()); + + int num2=Convert.ToInt32(Console.ReadLine()); + + Calculate calculate = new Calculate(num1,num2); + Console.WriteLine("请输入操作符:"); + string z=Console.ReadLine(); + switch (z) + { + case "+": + jia jia = new jia(num1, num2); + Run(jia); + break; + case "-": + jian jian = new jian(num1, num2); + Run(jian); + break; + } + } + public static void Run(Calculate calculate) + { + calculate.DisplayResult(); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/jia.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/jia.cs" new file mode 100644 index 0000000000000000000000000000000000000000..7757947022492e630e7c61aae70786cc74f41807 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/jia.cs" @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace duot +{ + internal class jia:Calculate + { + public jia(int num1, int num2):base(num1, num2){} + public override void DisplayResult() + { + Console.WriteLine($"{num1}+{num2}={num2+num1}"); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/jian.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/jian.cs" new file mode 100644 index 0000000000000000000000000000000000000000..32270a7a4739663ed16cacb18dc7b924851699d4 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(1)/jian.cs" @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.PerformanceData; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace duot +{ + internal class jian:Calculate + { + public jian(int num1,int num2):base(num1,num2) { } + public override void DisplayResult() + { + Console.WriteLine($"{num1}-{num2}={num1-num2}"); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Circle.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Circle.cs" new file mode 100644 index 0000000000000000000000000000000000000000..bc1c6609a59117ce5ce12bfbd26dc73176e22939 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Circle.cs" @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp1 +{ + internal class Circle:Shape + { + double radius; + public Circle(double radius) + { + this.radius = radius; + } + + public override double GetArea() + { + return 3.14+radius*radius; + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Program.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Program.cs" new file mode 100644 index 0000000000000000000000000000000000000000..9711eb16a75c937fa0b3bf4c0db6cda875427707 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Program.cs" @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Permissions; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp1 +{ + internal class Program + { + static void Main(string[] args) + { + Circle circle = new Circle(12); + circle.color = "五彩斑斓的黑"; + PrintArea(circle); + + Square square= new Square(2); + square.color = "black"; + PrintArea(square); + } + public static void PrintArea(Shape shape) + { + Console.WriteLine(shape.GetArea()); + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Shape.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Shape.cs" new file mode 100644 index 0000000000000000000000000000000000000000..0bc96e4c16e5b48316642e8bcf997814bbcb4c80 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Shape.cs" @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp1 +{ + internal class Shape + { + public string color { get; set; } + public abstract double GetArea() ; + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Square.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Square.cs" new file mode 100644 index 0000000000000000000000000000000000000000..29fd6a2b218bbdbd1032e539afb1765c488bd386 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\215\201\346\254\241\344\275\234\344\270\232/\345\244\232\346\200\201(2)/Square.cs" @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp1 +{ + internal class Square:Shape + { + double side; + public double sid { get { return side ; }set { side = value; } } + public Square() { } + public Square(double side) + { + this.side = side ; + } + + public override double GetArea() + { + return side*side ; + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/RPG.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/RPG.cs" new file mode 100644 index 0000000000000000000000000000000000000000..ad93639e7fd510bbf7422228246f64eae19e3ef5 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/RPG.cs" @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RPG +{ + internal class Program + { + enum RPG + { + 战士, + 法师, + 精灵 + } + static void Main(string[] args) + { + for (int i = 1; i >= 0; i++) + { + Console.WriteLine("选择你的职业\n1.战士\n2.法师\n3.精灵"); + int r = (int)(RPG)Convert.ToInt32(Console.ReadLine()); + if ((int)r == 1) + { + Console.WriteLine($"职业:{r}\n技能:碎石打击、烈焰锚钩、战斗咆哮"); + break; + } + else if ((int)r == 2) + { + Console.WriteLine($"职业:{r}\n技能:巨浪冲击、元素突击、复仇杀戮"); + break; + } + else if ((int)r == 3) + { + Console.WriteLine($"职业:{r}\n技能:减速陷阱、能量浪潮、旋风剑舞"); + break; + } + else + { + Console.WriteLine($"选择错误,重新选择"); + } + } + } + } +} diff --git "a/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/\346\260\264\346\236\234.cs" "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/\346\260\264\346\236\234.cs" new file mode 100644 index 0000000000000000000000000000000000000000..af257c5057000767b0a13fc84e54ddb83b507671 --- /dev/null +++ "b/49\345\274\240\346\240\207\346\230\237\345\256\211/\347\254\254\345\233\233\346\254\241\344\275\234\344\270\232/\346\260\264\346\236\234.cs" @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace 水果 +{ + internal class Program + { + enum Fruit + { + 葡萄, , + 草莓, + 奇异果, + 苹果, + 香蕉, + 哈密瓜, + 西瓜 + } + static void Main(string[] args) + { + Random f = new Random(); + for (int i = 0; i < 10; i++) + { + Random random = new Random(); + int command = random.Next(); + Console.WriteLine((Fruit)command + "水果分数为" + (command + 1)); + } + Console.WriteLine("游戏结束"); + } + } +}