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 ...
随机推荐
- HDU 5239 上海大都会 D题(线段树+数论)
打表,发现规律是存在一定次数(较小)后,会出现a=(a*a)%p.可以明显地发现本题与线段树有关.设置标记flag,记录本段内的数是否均已a=a*a%p.若是,则不需更新,否则更新有叶子结点,再pus ...
- ACdream 1112 Alice and Bob (博弈&&素数筛选优化)
题目链接:传送门 游戏规则: 没次能够将一堆分成两堆 x = a*b (a!=1&&b!=1)x为原来堆的个数,a,b为新堆的个数. 也能够将原来的堆的个数变成原来堆的约数y.y!=x ...
- uiautomator +python 安卓UI自动化尝试
使用方法基本说明:https://www.cnblogs.com/mliangchen/p/5114149.html,https://blog.csdn.net/Eugene_3972/article ...
- QPS计算
案例:公司xiaoyb性能测试评估 我们预估支持500家学校,每所学校300人,每天有10%的活跃率,每天有500*300*10%=15000人,每人每天平均请求20次,每天大概请求时间共8小时,80 ...
- Project Euler:Problem 33 Digit cancelling fractions
The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplif ...
- ListView点击或选中item改变背景
点击或选中ListView中的一项后.使item背景改变,失去焦点相同显示选中的背景.又一次选中另外一项才刷新: 在Adapter中配置: public class MyAdapter extends ...
- hdu1325 Is It A Tree?(二叉树的推断)
Is It A Tree? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
- ASP.NET MVC中的嵌套布局页
在WEB窗体模式中,用惯了母版页,并且常有母版页嵌套的情况. 而在MVC模式下,对应母版页的,称作为布局页.默认的布局页为 ~/Views/Shared/_Layout.cshtml.默认每个页面都会 ...
- easyui+struts2:datagrid无法不能得到数据
转自:https://bbs.csdn.net/topics/390980437 easyui+struts2:datagrid无法访问到指定action: userlist.jsp部分代码: XML ...
- C语言程序判断文件夹是否存在
#include <stdio.h> #include <io.h> int main(void){ if ( !access("C://Users/hui" ...