自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1009 Product of Polynomials (25 分)

This time, you are supposed to find A×BA×BA×B where AAA and BBB are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 222 lines, and each line contains the information of a polynomial:K N​1​​ a​N​1​

2021-07-13 22:59:36 140

原创 1007 Maximum Subsequence Sum (25 分)

Given a sequence of KKK integers { N​1​​,N​2​,...,N​K​​N​_1​​ , N​_2​ , ..., N​_K​​N​1​​​,N​2​​,...,N​K​​​ }. A continuous subsequence is defined to be { N​i​​,N​i​+​1​​,...,N​jN_​i​​ , N​_i​_+​_1​​ , ..., N​_jN​​i​​,N​i​​+​​1​​​,...,N​j​​​ } where 1≤i≤j

2021-07-11 14:05:02 85

原创 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<1000<N<1000<N&l

2021-07-11 03:15:04 84

原创 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 floor, and 4 seconds to

2021-07-10 14:11:53 97

原创 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 the ones who have unlocked and loc

2021-07-09 00:19:41 55

原创 1005 Spell It Right (20 分)

Given a non-negative integer NNN, your task is to compute the sum of all the digits of NNN, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each case occupies one line which contains an N(≤10​1​0​0

2021-07-08 23:52:31 52

原创 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 of cities are marked

2021-07-07 23:16:01 65

原创 1002 A+B for Polynomials (25 分)

This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:K N1​​ a​N​1​​ ​​ N​2​​ a​N​2​​ ​

2021-07-07 22:30:03 70

原创 利用链表实现一元多项式的加减

#include <stdio.h>#include <math.h>#include <stdlib.h>typedef struct z{ double xishu; int zhishu; struct z *next;}Z;Z *creat();Z *sort_del(Z *);void print(Z *);void print1(Z *); // 输出并释放内存 Z *add(Z *,Z *

2021-07-07 22:02:42 443

原创 算符优先的思想实现一个简易计算器

思想:类似于编译原理中自下而上进行语法分析的算符优先分析法。#include <stdio.h>#include <stdlib.h>#include <math.h>#define MAX 1009typedef double stack_num;typedef char stack_ch;char cmp[8][8]={'0','+','-','*','/','(',')','=', '+','>','>','

2021-07-07 21:56:54 511

原创 1001 A+B Format (20 分)

1001 A+B Format (20 分)你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。新的改变我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:全新的界面设计 ,将会带来全新的写作体验;在创作中心设置你喜爱的代码高亮样式,Markdown 将代码片显示选择的高亮样式 进行展示;

2021-07-07 00:20:56 127

转载 new与malloc的10点区别

new与malloc的10点区别转载自:https://www.cnblogs.com/QG-whz/p/5140930.html 前言几个星期前去面试C++研发的实习岗位,面试官问了个问题:new与malloc有什么区别?这是个老生常谈的问题。当时我回答new从自由存储区上分配内存,malloc从堆上分配内存;new/delete会调用构造函数/析构函数对对象进行初始化与销毁;operator new/delete可以进行重载;然后强行分析了一下自由存储区与堆的区别。回来后感觉这个问

2021-01-17 20:24:43 160 1

原创 C语言存储类别和内存管理的一些知识总结。

存储期、作用域、链接存储期描述了通过这些标识符访问的对象的生存期。C对象有4中存储期:静态存储期、线程存储期、自动存储期、动态分配存储期。具有静态存储期的对象,在程序的执行期间一直存在。具有线程存储期的对象,从被声明时到线程结束一直存在。具有自动存储期的对象,从定义处到块末尾一直存在。动态分配的内存在调用malloc()或calloc()时存在,在调用free()函数时释放掉。我们在下面只考虑静态存储期和自动存储期。作用域描述程序中可访问标识符的区域。作用域分为:块作用域、函数作用域、函数

2020-12-05 17:15:48 130

原创 C语言关于指针,gets()和gets_s()函数的理解

C语言关于指针,gets()和gets_s()函数的理解使用const修饰一个指针int a[5] = {0, 1, 2, 3, 4};//第一种,指针p1不能修改指向地址上的值。const int * p1 = a;//第二种,指针p2不能更改它所指向的地址。int * const p2 = a;//第三种,指针p3既不能修改指向地址上的值,也不能更改它所指向的地址。const int * const p3 =a;二维指针二维指针的两种声明。int (*p)[4]; //声明数

2020-12-05 04:31:36 4462

空空如也

空空如也

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

TA关注的人

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