55问答网
所有问题
当前搜索:
编写一个控制台程序
用C#
编写一个控制台程序
,假设10个整数用一个一堆数组存放,求其最大值...
答:
for (int i = 0; i < num.Length - 1; i++){ for (int j = 0; j < num.Length - 1 - i; j++){ if (num[j] > num[j + 1]){ int temp = num[j];num[j] = num[j + 1];num[j + 1] = temp;} 采用冒泡排序,取第
一个
和最后一个 } } ...
采用C#
编写一个
基于
控制台程序
答:
答:struct Student{ public string sID; // 学号 public string sName; // 姓名 public SexFlag sex; // 性别 public string sBirthday; // 生日}问3)创建
一个
Student数组,用来存储学生人数及学生个人信息。学生人数及个人信息需要用户从
控制台
交互输入。答:Student []stus = new...
编写一个控制台
应用
程序
项目Proj6-18用于求学生的GPA。GPA是英文平均分...
答:
编写一个控制台
应用
程序
项目Proj6-18用于求学生的GPA。GPA是英文平均分的简称。美国大学的GPA满分是4分。例如某学生的5门课程的学分和成绩为: 课程1有4个学分,成绩92(A); 课程2有3个学分,成绩80(B); 课程3有2个学分,成绩98(A); 课程... 展开 guo...
C#
控制台
编写一个程序
,定义一个数组,用for语句输入10个数存入数组,然...
答:
i = 0; i < 9; i++){ for (int j = i + 1; j < 10; j++){ if (a[i] < a[j]) //逆序 { int t = a[i];a[i] = a[j];a[j] = t;} } } for (int i = 0; i < 10; i++){ Console.Write("{0} ",a[i]);//输出 } Console.ReadKey();} } ...
c#程序,
编写一个控制台程序
,输入一个小写字母,要求输出它的大写字母...
答:
代码较简单,就不注释了,有不懂的话再问,满意的话就采纳了吧!using System;namespace test{ class Program { static void Main(string[] args) { Console.Write("请输入
一个
字母:"); char c = (char)Console.Read(); if (Char.IsLetter(c)) { if (Char....
C#
编写一个控制台程序
,要求定义一个二维数组来存放一个10*10的矩阵
答:
static void Main(string[] args){ int[,] arr = new int[10, 10]; int sum = 0; Console.WriteLine("请输入数组的第
一个
数字:"); var str = Console.ReadLine(); int first = int.Parse(str); //转成int //数组的下标是从0,0开始的,但人为意识是从1,1开始,...
C# 用
控制台
应用
程序
编写一个
矩形类
答:
using System;namespace ConsoleApplication1{ // 矩形类 public class Rectangle { private float width; private float height; //构造函数:参数为宽度width和高度height public Rectangle(float width, float height) { this.width = width; this.height = height; ...
利用C#
编写一个控制台
应用
程序
,实现用户输入学号,姓名,班级等信息后...
答:
using System;using System.Collections.Generic;using System.Text;using System.Data.OleDb;using System.Data;using System.Text.RegularExpressions;namespace Demo6{ class Program { static void Main(string[] args) { Console.WriteLine("学号"); string xuehao = Console.ReadLine...
编写一个控制台程序
,分别输出1~100之间的平方、平方根、自然对数、e指...
答:
include <stdio.h> include <math.h> int main(){ int i = 0;double e=2.7182818284590452353602874713526;for (i =
1
; i < 101; i++){ printf("%3d的平方: %6d\n", i, i*i);} for (i = 1; i < 101; i++){ printf("%3d的开方: %6.3lf\n", i, sqrt(i));} for...
用JAVA
编写程序
实现在
控制台
用“*”输出
一个
倒立的等边三角型,并写到...
答:
3、再
编写
输出triangle.txt文件的代码,public void outPrint(String str1) { try { PrintStream ps = new PrintStream("triangle.txt");ps.append(str1);ps.close();} catch (FileNotFoundException e) { e.printStackTrace();} } 4、执行java代码,
控制台
输出*号倒三角,5、查看triangle.txt...
<涓婁竴椤
1
2
3
4
5
6
7
8
9
10
涓嬩竴椤
灏鹃〉
其他人还搜