- 博客(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 N1 aN1
2021-07-13 22:59:36 150
原创 1007 Maximum Subsequence Sum (25 分)
Given a sequence of KKK integers { N1,N2,...,NKN_1 , N_2 , ..., N_KN1,N2,...,NK }. A continuous subsequence is defined to be { Ni,Ni+1,...,NjN_i , N_i_+_1 , ..., N_jNi,Ni+1,...,Nj } where 1≤i≤j
2021-07-11 14:05:02 97
原创 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 93
原创 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 104
原创 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 63
原创 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(≤10100
2021-07-08 23:52:31 57
原创 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 74
原创 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 aN1 N2 aN2
2021-07-07 22:30:03 79
原创 利用链表实现一元多项式的加减
#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 459
原创 算符优先的思想实现一个简易计算器
思想:类似于编译原理中自下而上进行语法分析的算符优先分析法。#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 522
原创 1001 A+B Format (20 分)
1001 A+B Format (20 分)你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。新的改变我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:全新的界面设计 ,将会带来全新的写作体验;在创作中心设置你喜爱的代码高亮样式,Markdown 将代码片显示选择的高亮样式 进行展示;
2021-07-07 00:20:56 135
转载 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 171 1
原创 C语言存储类别和内存管理的一些知识总结。
存储期、作用域、链接存储期描述了通过这些标识符访问的对象的生存期。C对象有4中存储期:静态存储期、线程存储期、自动存储期、动态分配存储期。具有静态存储期的对象,在程序的执行期间一直存在。具有线程存储期的对象,从被声明时到线程结束一直存在。具有自动存储期的对象,从定义处到块末尾一直存在。动态分配的内存在调用malloc()或calloc()时存在,在调用free()函数时释放掉。我们在下面只考虑静态存储期和自动存储期。作用域描述程序中可访问标识符的区域。作用域分为:块作用域、函数作用域、函数
2020-12-05 17:15:48 139
原创 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 4494
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人