![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#常见编程
d_Outlier
这个作者很懒,什么都没留下…
展开
-
c#简单编程
1.输出1-100中所有不能被3整除的数 for(int i=0;i<=100;i++){ if(i%3 != 0){ Console.WriteLine("不能被三整除的"+i); } } 2.使用while语句求1到100中的奇数和。static void Main(...原创 2020-07-15 22:46:15 · 1273 阅读 · 0 评论 -
c#编程
1.按要求编写C#程序编写一个接口:InterfaceA,只含有一个方法int method(int n);编写一个类:ClassA来实现接口InterfaceA,实现int method(int n)接口方法时,要求计算1到n的和;编写另一个类:ClassB来实现接口InterfaceA,实现int method(int n)接口方法时,要求计算n的阶乘(n!);在 Program类的Main方法里面测试实现接口的类classProgram{stat...原创 2020-06-30 00:14:10 · 4108 阅读 · 0 评论 -
C#常见编程
1.求数组中的最大值和最小值并输出。如:int[] a={1,34,5,9,23,0,40,22}staticvoidMain(string[] args){int[] a = { 1, 34, 5, 9, 23, 0, 40, 22 };intmax = a[0];intmin = a[0];for(inti = 1; i < a.Length - 1...原创 2020-06-30 00:04:37 · 618 阅读 · 0 评论 -
C#常见编程
1.编写一段程序,运行时向用户提问“你考了多少分?(0~100)”,接受输入后判断其等级并显示出来。判断依据如下:等级={优 (90~100分);良 (80~89分);中 (60~69分);差 (0~59分);}staticvoidMain(string[] args){Console.WriteLine("你考了多少分?(1~100)");inta = int.Parse(Console.ReadLine());...原创 2020-06-25 21:28:47 · 881 阅读 · 0 评论