C#第十二节课
数组
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace shuzu
{
class Program
{
static void Main(string[] args)
{
for (; ; )
{
//一维数组【相同数据类型】
//第一种定义方式
//int[] shuzu = new int[5];
//for (int i = 0; i < 5; i++)
//{
// shuzu[i] = i + 1;
//}
// //索引从0开始
// //赋值
// //shuzu[0] = 1;
// //shuzu[1] = 2;
// //shuzu[2] = 3;
// //shuzu[3] = 4;
// //shuzu[4] = 5;
// ////shuzu[5] = 6;
// ////shuzu[6] = 7;
// Console.WriteLine(shuzu[4]);
//第二种定义方式
//int[] shuzu = new int[] { 1,2,3,4,5 };
//Console.WriteLine(shuzu[2]);
//从控制台输入10个人的年龄放入数组,
//将十个人的年龄求总和
//int [] age=new int [10];
//int sum = 0;
//for (int i = 0; i < 10; i++)
//{
// Console.Write("请输入第"+(i+1)+"个人的年龄:");
// age[i] = int.Parse(Console.ReadLine());
// sum += age[i];
//}
//Console.WriteLine(sum);
//输入人名放进数组,输出第5个人的姓名
//Console.Write("请输入有几个人:");
//int a = int.Parse(Console.ReadLine());
//string [] name =new string [a];
//for (int i = 0; i < a;i++ )
//{
// Console.Write("请输入第" + (i + 1) + "个人的姓名:");
// name[i] = Console.ReadLine();
//}
//Console.WriteLine(name[4]);
//输入班级人数,根据人数,
//挨个输入成绩,求平均分
//Console.Write("请输入班级人数:");
//int a = int.Parse(Console.ReadLine());
//double [] fen = new double [a];
//double sum = 0;
//for (int i = 0; i < a;i++ )
//{
// Console.Write("请输入第"+(i+1)+"个人的分数:");
// fen[i] = double.Parse(Console.ReadLine());
// sum += fen[i];
//}
//Console.WriteLine("班级平均分为:"+sum/a);
//二维数组
//int[,] shuzu = new int[3, 4];
//int[,] shuzu = new int[,] {
//{1,2,3,4},
//{5,6,7,8},
//{6,7,8,9}
//};
//string[,] shuzu = new string[,] {
//{" ","■","■","■","■","■",""},
//{" "," "," ","■","","",""},
//{" "," "," ","■","","",""},
//{" "," ","■","■","■","",""},
//{" "," "," ","■"," "," ",""},
//{" "," "," ","■"," "," ",""},
//{"■","■","■","■","■","■","■"}
//};
//for (int i = 0; i < 7; i++)
//{
// for (int j = 0; j < 7; j++)
// {
// Console.Write(shuzu[i, j]);
// }
// Console.WriteLine();
//}
//输入班级人数,将每个人的
//语文,数学,英语成绩输入二维数组
//Console.Write("请输入班级人数:");
//int a = int.Parse(Console.ReadLine());
//double [,] shuzu = new double [a,3];
//for (int i = 0; i < a; i++)
//{
// for (int j = 0; j < 3; j++)
// {
// if (j == 0)
// {
// Console.Write("请输入第"+(i+1)+"个人的语文成绩:");
// }
// if (j == 1)
// {
// Console.Write("请输入第" + (i + 1) + "个人的数学成绩:");
// }
// if (j == 2)
// {
// Console.Write("请输入第" + (i + 1) + "个人的英语成绩:");
// }
// shuzu[i, j] = double.Parse(Console.ReadLine());
// }
//}
// Console.ReadLine();
//三维数组
//int[, ,] shuzu = new int[3, 2, 4];
//{
// {
// {,,,},
// {,,,}
// },
// {
// {,,,},
// {,,,}
// },
// {
// {,,,},
// {,,,}
// }
//};
string[,] a = new string[8, 8]{
{" "," ","||"," "," "," "," "," "},
{" "," ","||"," "," ","//"," "," "},
{" ","==","++","==","||","==","==","||"},
{" "," ","||"," ","||"," "," ","||"},
{" ","//","||","\\ ","||","==","==","||"},
{" /","/ ","||"," ","||"," "," ","||"},
{" "," ","||"," ","||"," "," ","||"},
{" "," ","||"," ","||","==","==","=="},
};
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
Console.Write(a[i,j]);
}
Console.WriteLine();
}
Console.ReadLine();

}
Console.ReadLine();
}
}
}
C#第十二节课的更多相关文章
- centos vmware centos6.6 64位 kvm虚拟化安装配置 第四十二节课
centos vmware centos6.6 64位 kvm虚拟化安装配置 第四十二节课 上半节课 下半节课 f
- centos HA高可用集群 heartbeat搭建 heartbeat测试 主上停止heartbeat服务 测试脑裂 两边都禁用ping仲裁 第三十二节课
centos HA高可用集群 heartbeat搭建 heartbeat测试 主上停止heartbeat服务 测试脑裂 两边都禁用ping仲裁 第三十二节课 heartbeat是Linu ...
- centos LAMP第四部分mysql操作 忘记root密码 skip-innodb 配置慢查询日志 mysql常用操作 mysql常用操作 mysql备份与恢复 第二十二节课
centos LAMP第四部分mysql操作 忘记root密码 skip-innodb 配置慢查询日志 mysql常用操作 mysql常用操作 mysql备份与恢复 第二十二节课 mysq ...
- centos shell基础 alias 变量单引号 双引号 history 错误重定向 2>&1 jobs 环境变量 .bash_history source配置文件 nohup & 后台运行 cut,sort,wc ,uniq ,tee ,tr ,split, paste cat> 2.txt <<EOF 通配符 glob模式 发邮件命令mail 2015-4-8 第十二节课
centos shell基础知识 alias 变量单引号 双引号 history 错误重定向 2>&1 jobs 环境变量 .bash_history source配置文件 ...
- 风炫安全web安全学习第三十二节课 Python代码执行以及代码防御措施
风炫安全web安全学习第三十二节课 Python代码执行以及代码防御措施 Python 语言可能发生的命令执行漏洞 内置危险函数 eval和exec函数 eval eval是一个python内置函数, ...
- 风炫安全WEB安全学习第二十二节课 DOM型XSS讲解
风炫安全WEB安全学习第二十二节课 DOM型XSS讲解 Dom型XSS演示 通过Javascript,可以重构整个HTML文档,你可以添加.移除.改变或重排页面上的项目 要改变页面的某个东西,Java ...
- 12、第十二节课,css伪类 (转)
一.特殊选择器 1.* 用于匹配任何的标记 2.> 用于指定父子节点关系 3.E + F 毗邻元素选择器,匹配所有紧随E元素之后的同级元素F 4.E ~ F 匹配所有E元素之后的同级元素F 5. ...
- 《linux就该这么学》第十二节课:第10章,Apache网站服务
第十章 10.1.网站服务程序 (让用户能够通过网站访问服务器上的资源) 目前提供的网站服务有IIS,Nginx,Apache等,IIS是windows中默认的web服务程序. Nginx是后起之秀, ...
- php第二十二节课
AJAX <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...
- php第十二节课
练习 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.o ...
随机推荐
- 使用memcachedclientXmemcached与Spring整合
1 简单介绍 Xmemcached是一个高性能的基于java nio的memcachedclient.在经过三个RC版本号后.正式公布1.10-final版本号. xmemcached特性一览: 1. ...
- java js url传参中文乱码
String item = this.getRequest().getParameter("item"); item = new String(item.getBytes(&quo ...
- hdoj- Windows Message Queue
Windows Message Queue Problem Description Message queue is the basic fundamental of windows system. ...
- Makefile 文件怎么写
跟我一起写Makefile:MakeFile介绍 Makefile 使用总结 1. make 命令与 Makefile 文件 在 Linux 平台,执行 make 命令时,会在当前目录下寻找 Make ...
- [POJ 3565] Ant
[题目链接] http://poj.org/problem?id=3565 [算法] KM算法求最小匹配 [代码] #include <algorithm> #include <bi ...
- nested exception is java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter
转自:https://blog.csdn.net/licheng989/article/details/28929411 在Bean中有代码 public abstract Axe getAxe(); ...
- leetcode链表相关
目录 2/445两数相加 综合题(328奇偶链表, 206反转链表, 21合并两个有序链表 ) 92反转链表 II 链表排序(148排序链表, 876链表的中间结点) 142环形链表 II 160相交 ...
- 如何修改vos2009/vos3000的web端口?
vos 2009. VOS 3000 2120 -2138版本在这里 /usr/apache-tomcat-5.5.15/conf 编辑 server.xml 找到 <!-- Define a ...
- Arranging Your Team
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=35800#problem/D #include <iostream> #inc ...
- Django day02
一:Django 中 app 的概念 每个项目里面都会 有很多不同的模块,我们可以把它们写在一个项目里,我们把模块分成一个一个不同的app,这样写可以便于管理,写的一些项目也可能不单单是一个页面,还可 ...