摘要: 最近宿舍公用的网络一直不太稳定,正赶上毕业季,本来就打算自己买一台自用的路由器,于是我从一个毕业的师姐手里15RMB收了一台路由器,师姐还给了我一根5m的网线和两根全新15m的,感觉光网线就赚翻了。 下面是设置路由器上网的步骤 一、连接线路 将前端上网的宽带线连接到路由器的WAN口,上网电脑连接到路 阅读全文
posted @ 2018-07-08 12:51 王陸 阅读(908) 评论(0) 推荐(0) 编辑
摘要: 转载自:https://www.jb51.net/article/61506.htm 1、编译时计算运算符sizeof,可用类型或变量做参数,计算占用内存的大小。sizeof后若是类型必须加括弧,若是变量名可不加括弧。sizeof(x)可用来定义数组维数如: printf("%d\n", sizeo 阅读全文
posted @ 2018-07-06 13:07 王陸 阅读(632) 评论(0) 推荐(0) 编辑
摘要: Description Bessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. 阅读全文
posted @ 2018-06-30 08:52 王陸 阅读(342) 评论(0) 推荐(0) 编辑
摘要: Description Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. 阅读全文
posted @ 2018-06-29 21:56 王陸 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Description There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., 阅读全文
posted @ 2018-06-29 21:39 王陸 阅读(303) 评论(0) 推荐(0) 编辑
摘要: Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than o 阅读全文
posted @ 2018-06-29 20:18 王陸 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 畅通工程 Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input 测试输入包含若干 阅读全文
posted @ 2018-06-28 16:00 王陸 阅读(470) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; int gCard[52]; int num_card; struct sCard { int naPip[5]; //一共5张牌 int nNumber; //发了多少张牌 int nDollar;... 阅读全文
posted @ 2018-06-27 16:56 王陸 阅读(199) 评论(0) 推荐(0) 编辑
摘要: You are given nn strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string 阅读全文
posted @ 2018-06-26 16:25 王陸 阅读(1160) 评论(0) 推荐(0) 编辑
摘要: You are given n switches and m lamps. The i-th switch turns on some subset of the lamps. This information is given as the matrix aconsisting of n rows 阅读全文
posted @ 2018-06-26 16:06 王陸 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 转载自:c.biancheng.net/view/159.html 输入输出函数(printf 和 scanf)是C语言中非常重要的两个函数,也是学习C语言必学的两个函数。在C语言程序中,几乎没有一个程序不需要这两个函数,尤其是输出函数(printf),所以这两个函数必须要掌握。 如果在程序中要使用 阅读全文
posted @ 2018-06-26 15:13 王陸 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 说明此程序本来是21点扑克程序的一个被调函数,在这里我单独将它拿出来作为一个小程序。 阅读全文
posted @ 2018-06-26 11:13 王陸 阅读(1611) 评论(0) 推荐(0) 编辑
摘要: In the Bus of Characters there are nn rows of seat, each having 22 seats. The width of both seats in the ii-th row is wiwi centimeters. All integers w 阅读全文
posted @ 2018-06-26 08:59 王陸 阅读(315) 评论(0) 推荐(0) 编辑
摘要: i++ 与 ++i 的主要区别有两个:1、 i++ 返回原来的值,++i 返回加1后的值。2、 i++ 不能作为左值,而++i 可以。 毫无疑问大家都知道第一点(不清楚的看下下面的实现代码就了然了),我们重点说下第二点。首先解释下什么是左值(以下两段引用自中文维基百科『右值引用』词条)。 左值是对应 阅读全文
posted @ 2018-06-25 14:44 王陸 阅读(2385) 评论(0) 推荐(0) 编辑
摘要: Description 你的朋友Mishka和你参加一个微积分讲座。讲座持续n分钟。讲师在第i分钟讲述ai个定理。 米什卡真的对微积分很感兴趣,尽管在演讲的所有时间都很难保持清醒。给你一个米什卡行为的数组t。如果Mishka在演讲的第一分钟睡着了,那么ti将等于0,否则它将等于1.当米什卡醒来时,他 阅读全文
posted @ 2018-06-23 14:01 王陸 阅读(250) 评论(0) 推荐(0) 编辑
摘要: A has a string consisting of some number of lowercase English letters 'a'. He gives it to his friend B who appends some number of letters 'b' to the e 阅读全文
posted @ 2018-06-22 20:45 王陸 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1、骑车与走路:我们的校园很大很大很大大大大大……,骑个自行车去办事会很快,比如取个快递了,到其他宿舍楼找个同(nv)学(you)了。但实际上,并非去办任何事情都是骑车快,因为骑车总要找车、开锁、停车、锁车等,这要耽误一些时间。假设找到自行车、开锁并骑上自行车的时间为27秒;停车、锁车的时间为23秒 阅读全文
posted @ 2018-06-22 11:58 王陸 阅读(1171) 评论(0) 推荐(2) 编辑
摘要: Description Polycarpus is an amateur businessman. Recently he was surprised to find out that the market for paper scissors is completely free! Without 阅读全文
posted @ 2018-06-21 14:40 王陸 阅读(414) 评论(0) 推荐(0) 编辑
摘要: Description Given a positive integer N, you should output the most right digit of N^N. Description Given a positive integer N, you should output the m 阅读全文
posted @ 2018-06-21 13:40 王陸 阅读(644) 评论(0) 推荐(0) 编辑
摘要: Description Bacon's cipher or the Baconian cipher is a method of steganography (a method of hiding a secret message as opposed to a true cipher) devis 阅读全文
posted @ 2018-06-21 13:12 王陸 阅读(1129) 评论(0) 推荐(0) 编辑
摘要: Description 根据给定的字符串生成二叉树并前序、中序、后序此二叉树。 根据给定的字符串生成二叉树并前序、中序、后序此二叉树。 根据给定的字符串生成二叉树并前序、中序、后序此二叉树。 Input 给定一字符串,其中#表示空。 例:上图输入为 HDB#A##C##G#FE### Input 给 阅读全文
posted @ 2018-06-20 15:17 王陸 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 一.文件基础和基本操作。 1.什么是文件? 为了长期保存数据以便重复使用、修改和共享,必须将数据以文件的形式存储到外部存储介质(如磁盘、U盘、光盘等)或云盘中。 文件:存储在外部介质上的数据或信息的集合 。 程序中的源程序 数据中保存着数据 图像中的像素数据 … 有序的数据序列。 2.文件中的编码 阅读全文
posted @ 2018-06-18 14:23 王陸 阅读(446) 评论(0) 推荐(1) 编辑
摘要: 1、随机生成20个两位正整数,将其升序排序后再写入文本文件data_asc.txt中! 2、定义一个函数is_prime(n),判断输入的n是不是素数,是的话返回True,否则返回False。通过键盘输入两个整数X和Y,调用此 函数输出两数范围之内素数的个数(包括X和Y)。利用文件实现,将表示范围的 阅读全文
posted @ 2018-06-18 13:57 王陸 阅读(536) 评论(0) 推荐(0) 编辑
摘要: Description文件a.dic、b.dic、c.dic中分别存有张三的三科成绩,每个文件都是16字节:前8个字节存储其英文名字zhangsan,后面是一个空格,其后的2个字节存储其年龄(文本方式存储),后面也是一个空格,最后4个字节存储的是某科考试成绩(二进制方式存储)。键盘输入一个数字(1, 阅读全文
posted @ 2018-06-10 21:11 王陸 阅读(2038) 评论(0) 推荐(0) 编辑
摘要: 1.用文本方式储存‘1’,‘0’,‘2’存入文件,然后用二进制方式从文件开头读出一个short型数据,并验证结果是否正确 也可以使用fwrite()将3个字符写入文件 以下文件的输出结果是(123,45) 把a.dic文件中的内容复制到b.dic中 文本方式读取一段文字 改写之后的程序: 计算该文件 阅读全文
posted @ 2018-06-10 20:33 王陸 阅读(603) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 typedef int ElemType; //数据类型 5 6 //定义二叉树结构,与单链表相似,多了一个右孩子结点 7 typedef struct BiTNode 8 { 9 ElemType data; //数据域 10 struct BiTNode ... 阅读全文
posted @ 2018-06-10 13:26 王陸 阅读(574) 评论(0) 推荐(0) 编辑
摘要: 定义概览 Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。 问题描述:在无向图 G=(V,E) 中,假设每条边 E[i] 的长度为 w[i],找到由顶点 V0 到其余各点的最短路径。(单源 阅读全文
posted @ 2018-06-09 16:32 王陸 阅读(9871) 评论(7) 推荐(11) 编辑
该文被密码保护。 阅读全文
posted @ 2018-06-07 16:47 王陸 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 关于图的几个概念定义: 关于图的几个概念定义: 连通图:在无向图中,若任意两个顶点vi与vj都有路径相通,则称该无向图为连通图。 强连通图:在有向图中,若任意两个顶点vi与vj都有路径相通,则称该有向图为强连通图。 连通网:在连通图中,若图的边具有一定的意义,每一条边都对应着一个数,称为权;权代表着 阅读全文
posted @ 2018-06-05 16:48 王陸 阅读(3730) 评论(0) 推荐(3) 编辑
摘要: 一.介绍 vector是表示可变大小数组的序列容器。 就像数组一样,vector也采用的连续存储空间来存储元素。也就是意味着可以采用下标对vector的元素进行访问,和数组一样高效。但是又不像数组,它的大小是可以动态改变的,而且它的大小会被容器自动处理。 本质讲,vector使用动态分配数组来存储它 阅读全文
posted @ 2018-06-03 21:42 王陸 阅读(1766) 评论(1) 推荐(0) 编辑