77问答网
所有问题
当前搜索:
控制台程序
在C#
控制台
应用
程序
中,对于一个学生类中的语文、数学和英语成绩,如何创 ...
答:
你好,软糖帮你写出来了。
程序
代码 class Program { public class 学生 { public decimal 语文成绩; public decimal 数学成绩; public decimal 英语成绩; } static void Main(string[] args) { Console.WriteLine("// 输入 x 退出本程序"); //请用户输入人数,循环直到正确...
C#
控制台
应用
程序
中一个项目能运行两个类吗
答:
类是类,根据类创建实例对象,几个对象都没问题 如果是特殊类,不需要创建对象,那么也是可以运行多个的 举例:CLASS A 是普通类,你创建类A的实例对象OBJ1,OBJ2,OBJ3。。。都可以在一个项目里,如果你有特殊类CLASS B,类B假如是个静态类,那么你直接调用静态方法,不创建实例对象,你也可以...
java
程序控制台
输出程序运行时间
视频时间 00:00
c#
控制台
应用
程序
怎么获取键盘上的上下左右键
答:
直接上代码,如下 public static void Main(String[] args){ bool tag = true;do { ConsoleKeyInfo info = Console.ReadKey();switch (info.Key){ case ConsoleKey.E:Console.WriteLine("exit");tag = false;break;case ConsoleKey.UpArrow:Console.WriteLine("Up");break;case ConsoleKey.Down...
用C#设计一个
控制台
应用
程序
项目,输入正整数n,计算s=1+(1+2)+(1+2...
答:
static void Main(string[] args){ Console.Write("请输入一个大于或等于1的整数:n="); var s = Console.ReadLine(); int n; if (int.TryParse(s, out n)) { Console.WriteLine(string.Format("计算结果:s={0}", calculate(n))); } else { Console...
C#中,编写
控制台
应用
程序
项目,读入一组整数(以输入0结束)分别求出奇偶...
答:
using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1 { class Program { static void Main(string[] args){ string strtemp = Console.ReadLine();Console.WriteLine("奇数和:{0}",jisuanjishuhe(strtemp));Console.WriteLine("偶数和:{0}", jisuanoushuhe...
编写一个
程序
,从键盘输入三个整数a.b.c,计算表达式a+b*c的值,并输出...
答:
1、以C#
控制台
应用
程序
为例:Console.WriteLine("输入3个整数,之间以逗号分隔,回车键结束...");string str = Console.ReadLine(); //读入用户输入信息 string[] input = str.Split(new char[] { ',' }); //以逗号为分隔符,分离出各项 if (input.Count() == 3) //不是3,用户输入...
各位大虾,如何在c#窗体
程序
中添加一个
控制台
应用程序,或者在控制台应用...
答:
start.UseShellExecute = false;//是否指定操作系统外壳进程启动
程序
Process p=Process.Start(start);StreamReader reader = p.StandardOutput;//截取输出流 string line = reader.ReadLine();//每次读取一行 while (!reader.EndOfStream){ tbResult.AppendText(line+" ");line = reader.ReadLine();...
C#
控制台
应用
程序
答:
public class Book //Book类 { public string name; //书名 public string author; //作业 public int pages; //页数 public int no; //图书编号 public void ShowBook(Book book){ Console.WriteLine("{0}{1}{2}{3}", name, author, pages, no);} //两个构造方法 public Book(){ }...
设置一个
控制台
应用
程序
项目通过委托方式求两个整数的平方和与平方差...
答:
class Program { // 声明委托 public delegate Double SquareCallback(Double x, Double y); public static Double GetSumResult(Double x, Double y) { return Math.Pow(x, 2)+Math.Pow(y,2); } public static Double GetSubtractionResult(Double x, Double y) {...
棣栭〉
<涓婁竴椤
6
7
8
9
11
12
13
14
10
15
涓嬩竴椤
灏鹃〉
其他人还搜