笔记
LL_yl
代码小白闯关中
展开
-
strstr()函数
strstr()函数头文件:#include<string.h>用处:判断串2是否为串1的子串结果:如果是,则该函数返回 str1字符串从 str2第一次出现的位置开始到 str1结尾的字符串;否则,返回NULL形式:strstr(s1,s2);原型:char *strstr(const char *s1,const char *s2)const保护数据的安全,char *为了实现链式访问...原创 2021-04-26 19:36:34 · 223 阅读 · 0 评论 -
roof(开N次方以及上下取整)
开N次方pow()函数头文件:#include<math.h>形式:pow(x,y)格式:表示对x开y次方x,y,函数返回值都为double型y不可以为小数x,y不可同为0上下取整函数向上取整形式:floor(x)含义:floor(x)返回的是小于或等于x的最大整数,floor(x)是向负无穷大舍入返回形式:double型(c语言)eg:floor(-2.5)=-3向下取整形式:ceil(y)含义:ceil(x)返回的是大于x的最小整数,ceil()是向正无原创 2021-02-22 19:18:12 · 362 阅读 · 0 评论 -
Martian
这题讲火星人敲代码。。。就离谱DescriptionIn the 22nd Century, scientists have discovered intelligent residents live on the Mars. Martians are very fond of mathematics. Every year, they would hold an Arithmetic Contest on Mars (ACM). The task of the contest is to calcul原创 2020-12-24 15:12:22 · 163 阅读 · 0 评论 -
Beautiful numbers(前缀和思想)
A - OlympiadDescriptionYou are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is called beautiful if and only if all of its digitals are different (i.e. 12345 is beautiful, 11 is not b原创 2020-12-22 20:35:05 · 563 阅读 · 0 评论 -
Reversed Numbers
Reversed Numbers原创 2020-12-12 10:37:38 · 285 阅读 · 0 评论 -
Word Reversal
Word ReversalDescriptionFor each list of words, output a line with each word reversed without changing the order of the words.InputThe first line contains a positive integer indicating the number of cases to follow. Each case is given on a line contain原创 2020-12-11 07:07:32 · 211 阅读 · 0 评论 -
sort
sort使用sort,首先头文件:#include【在c++里要多加一个 using namespace std; 】形式:sort(first_pointer,first_pointer+n,cmp)有三个参数,第一个参数是写数组的首地址【一般写数组名即可】;第二个参数写首地址+数组长度n;第三个参数写比较函数的名称【自定义函数cmp】。如果第三个参数不写,则sort默认按数组升序排序。【eg:将数组a的0~n-1个元素按升序排序—— sort(a,a+n); 】如果要写降序排列要写一个原创 2020-12-09 06:33:06 · 2143 阅读 · 0 评论