随笔分类 - C#基础
摘要:static void Main(string[] args) { while (true) { try { Console.Write("请输入一个数:"); int n = Convert.ToInt32(Console.ReadLine()); int i = 1; int s = 0, z...
阅读全文
摘要:static void Main(string[] args) { while (true) { int n = 0; for (int g = 1; g*2 <=100; g++) { for (int m = 1; m*1 <=100; m++) { for (int x = 1; x*0.5...
阅读全文
摘要:namespace for嵌套for五角星{ class Program { static void Main(string[] args) { while (true) { string a = "★";//注意换行与不换行的应用,如果要去掉对角线的话往上的话只要j<=i即可。 for (int ...
阅读全文
摘要:namespace 纸张的厚度循环{ class Program { static void Main(string[] args) { while (true) { double a; Console.WriteLine("请输入纸张的厚度:(毫米)"); a =Convert.ToDouble(...
阅读全文
摘要:namespace 烧开水循环跳转{ class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Green; Console.Clear(); while (true) { st...
阅读全文
摘要:{ class Program { static void Main(string[] args) { while (true) { int sum = 0; for (int i = 1; i 49 && a <= 100) { sum = sum + 10; Console.WriteLine...
阅读全文
摘要:static void Main(string[] args) { while (true) { int ct=0,xt=0,yt=1,zt=1,m; Console.WriteLine("请输入月数:"); m = Convert.ToInt32(Console.ReadLine()); for...
阅读全文
摘要:class Program { static void Main(string[] args) { while (true) { int a, b; int s = 0; Console.WriteLine("请输入第一个数:"); a = Convert.ToInt32(Console.Read...
阅读全文
摘要:static void Main(string[] args) { while (true) { int a, b, c,m,n; Random r = new Random(); //主要的就是三位数的百分位最大不会同时取到四位数的百分位,也就是说c永远小于b; a = r.Next(1,10);...
阅读全文
摘要:static void Main(string[] args) { while (true) //主要就是公式的运用和if else的嵌套 { string a, b = ""; double c, d, e,s,q; double m = 6.55 / 100 / 12; double n = 4...
阅读全文
摘要:class Program { static void Main(string[] args) { while (true) { string a; Console.WriteLine("请问你有房吗:"); a = Console.ReadLine(); if (a == "有") { Cons...
阅读全文
摘要:class Program { static void Main(string[] args) { while (true) { double i,s,a,b,c,d,e,f; Console.Write("请输入当月利润:"); i = Convert.ToDouble(Console.Read...
阅读全文
摘要:static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Green; Console.Clear(); while (true) { Console.WriteLine("求方程式ax²+bx=c=0的根的情况...
阅读全文
摘要:static void Main(string[] args) { while (true) { int a; Random r = new Random(); a = r.Next(0,24); Console.WriteLine(a); if (a >= 0 && a = 6 && a = 12...
阅读全文
摘要:static void Main(string[] args) { while (true) { int x, y,z; string a, b,c; Random r=new Random();//这个是用的随机数随机生成,并且利用switch case赋予x,y,z成为"剪刀"石头""布""的含...
阅读全文
摘要:static void Main(string[] args) { while (true) { string a; Console.WriteLine("请问你有房吗:"); a = Console.ReadLine(); if (a == "有") { Console.WriteLine("请...
阅读全文
摘要:static void Main(string[] args) { while (true) { double x,y; Console.Write("请输入坐车的距离:"); x = Convert.ToDouble(Console.ReadLine()); if (x>0&&x 3 && x ...
阅读全文
摘要:static void Main(string[] args) { while (true) { int m1 = 31; int m2 = 28; int m3 = 31; int m4 = 30; int m5 = 31; int m6 = 30; int m7 = 31; int m8 = 3...
阅读全文
摘要:static void Main(string[] args) { while (true) { string a; int b; Console.Write("请输入您的姓名:"); a = Console.ReadLine(); Console.Write("请输入您的分数:"); b = C...
阅读全文
摘要:static void Main(string[] args) { while (true) { Console.Write("请输入一个100以内的数:"); int a =Convert.ToInt32(Console.ReadLine()); if(a>10&&a0) { Console.W...
阅读全文

浙公网安备 33010602011771号