自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(59)
  • 收藏
  • 关注

原创 1004 Counting Leaves (30分)

1004 Counting Leaves (30分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing 0<N&

2021-01-22 20:35:37 199

原创 1013 Battle Over Cities (25分)

1013 Battle Over Cities (25分)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other high

2021-01-22 19:33:42 174

原创 1009 Product of Polynomials C语言多项式乘积(25分)

1009 Product of Polynomials (25分)#include <iostream>using namespace std;double poly1[1001];double poly2[1001];double multiply[2002];int main(){ int n1, n2; int index; int count = 0; cin >> n1; for(int i=0; i<n1; i

2021-01-18 21:49:10 255

原创 1008 Elevator (20分)

1008 Elevator (20分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one flo

2021-01-18 20:46:33 146

原创 1007 Maximum Subsequence Sum (25分)

1007 Maximum Subsequence Sum (25分)Given a sequence of K integers { N​1, N​2 , …, N​K}. A continuous subsequence is defined to be { N​i, N​i+1, …, N​j} where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its el

2021-01-18 20:31:52 143

原创 1006 Sign In and Sign Out (25分)

1006 Sign In and Sign Out (25分)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s, you are supposed to find th

2021-01-18 17:35:53 145

原创 1005 Spell It Right (20分)

1005 Spell It Right (20分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each case occupies one line which c

2021-01-18 16:31:57 129

原创 1003 Emergency (25分)

1003 Emergency (25分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair

2021-01-17 16:47:00 152

原创 安装低版本ns-3注意事项(ubuntu1804,ns-3.26为例)

想要跑一下github上的ns-3项目源码,但是项目使用的是ns-3.26,自己虚拟机中的ns版本是3.31,版本问题导致无法运行,所以要在虚拟机中再安装旧版本的ns-3.26,两个版本可和谐共存安装步骤参照:https://www.cnblogs.com/variablex/archive/2020/11/04/13928867.html这里我只说一个大坑!低版本的ns3不能用太高版本的gcc和g++,否则在运行./build.py时会编译错误(如下图),需要降低gcc和g++版本...

2020-12-18 23:38:54 1745 4

原创 python调用上级目录中的函数(文件)

当被执行的脚本位置与工作路径不相同时,如何调用脚本的上级目录里的函数(文件)?比如,有一下目录结构,工作目录是FATHER,我想要在test.py中调用上级目录FATHER里的utils.py只需要在脚本中添加import sysimport ossys.path.append(os.path.dirname(sys.path[0]))import utilssys.path[0]:被执行脚本的绝对路径(不包含文件名)os.path.dirname():获取路径的目录名sys.path

2020-11-14 23:31:10 3825

原创 微信小程序——天气查询

1.外观颜色会随着天气改变而改变2.代码weather1.wxml<!--pages/weather1/weather1.wxml--><swiper indicator-dots="{{indicatorDots}}" indicator-color="rgba(255, 255, 255, .3)"> <!-- 第一页 --> <swiper-item class="card1 card" > <view class="

2020-07-27 13:10:15 1863 1

原创 安装两个版本的Python如何避免冲突

之前我在C盘里下载了32位的python3.7.2,而且已经有了pip,现在想要下载64位的python3.7.6,那怎样避免调用Python或pip的时候冲突?有两个方法第一个在安装新的python时候,勾选添加到环境变量,勾选安装pip,然后选择好自己想要安装的新位置。安装完毕后我的python和pip路径为:而之前版本的python是默认的安装路径以及pip路径这样有两个...

2020-04-13 20:58:17 2809

原创 MATLAB代码实现三次样条插值

参照《数值分析 第五版(李庆扬)》P42 2.6.2样条插值函数的建立目的是可以通过读取文本文件中提前存储坐标点,来实现三边界种类型的三次样条插值F.mfunction result = F(newton, a, b)%1阶差商求值 result = (newton(b, 2) - newton(a, 2)) / (newton(b, 1) - newton(a, 1));en...

2020-04-06 20:17:40 11738 1

原创 MATLAB代码实现龙贝格求积算法

这个是参照《数值分析 第五版(李庆扬)》P112 4.4.3龙贝格算法写出来的,有什么疑问直接看书就可以了。clear all;format long;s=input('请输入函数表达式:fx = ','s');fx=inline(s);a = input('请输入积分左边界a的值:');b = input('请输入积分右边界b的值:');accuracy = input('请输...

2020-04-06 19:59:18 16295 21

原创 python os.walk()遍历文件夹

利用os模块的os.walk(path)方法遍历计算机中的某个文件夹以及该文件夹下的所有子文件夹,传入的参数path是一个文件夹路径的字符串,如:‘C:\a\b’ 返回值有三个:1.当前文件夹(‘C:\a\b’ )名称的字符串。2.当前文件夹(‘C:\a\b’ )中子文件夹的路径字符串的列表,比如 [‘C:\a\b\1’, ‘C:\a\b\2’, …]3.当前文件夹(‘C:\a\b’ )中文...

2020-03-15 17:20:01 865 1

转载 python类内部调用自己的成员函数必须加self

转自博客园 作者 心媛意码https://www.cnblogs.com/Stephen-Qin/p/9781769.html

2020-03-09 22:03:52 724

原创 C语言统计不同单词数

统计输入的一个句子中有多少单词(不重复的),句子只有小写字母跟空格分析从头遍历输入的句子,把每个单词赋给字符串变量t,如果words字符串数组中没有该单词,则计数count+1,并把单词复制到words数组中代码#include <stdio.h>#include <stdlib.h>#include<string.h>int count=0;/...

2019-07-06 10:59:08 3315 2

原创 C语言数组题_校门外的树_标记法

题目描述某校大门外长度为L的马路上有一排树,每两棵相邻的树之间的间隔都是11米。我们可以把马路看成一个数轴,马路的一端在数轴00的位置,另一端在LL的位置;数轴上的每个整数点,即0,1,2,…,L0,1,2,…,L,都种有一棵树。由于马路上有一些区域要用来建地铁。这些区域用它们在数轴上的起始点和终止点表示。已知任一区域的起始点和终止点的坐标都是整数,区域之间可能有重合的部分。现在要把这些区域中...

2019-06-24 17:56:49 2141

原创 c语言函数的递归调用(汉诺塔问题,楼梯递归问题等)

c语言函数的递归调用(汉诺塔Hanoi问题,楼梯递归问题等)刚接触c语言的时候,感觉函数递归调用这里比较绕,难以理解,现在本着复习的目的,捋顺一下,介绍几个递归的题目。1.什么是递归调用函数的递归调用是指在调用一个函数的过程中直接或间接调用该函数本身。2.重点分析重点在于分析要解决的某个问题前n-1次和第n次过程存在的递归关系;再者,递归的起始条件的不要忽略,应单独写出。3.举例说明...

2019-06-18 21:55:57 2258

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除