请完成以下题目 class String { public: String(const char *str = NULL);// 普通构造函数 String(const String &other); // 拷贝构造函数 ~ String(void); // 析构函数 String & operat ...
分类:
其他好文 时间:
2020-11-07 16:20:20
阅读次数:
21
系列文章《C语言经典100例》持续创作中,欢迎大家的关注和支持。 喜欢的同学记得点赞、转发、收藏哦~ 后续C语言经典100例将会以pdf和代码的形式发放到公众号 欢迎关注:计算广告生态 即时查收 1 题目 题目:将一个数字字符串转换为一个整数(不得调用C语言中提供的字符串函数进行操作) 例如: 输入 ...
分类:
编程语言 时间:
2020-11-01 10:24:30
阅读次数:
22
#include<stdio.h>include<string.h>voidprint(chararr[]){intnum=strlen(arr);intend=num-1;for(intstart=0;start<=end;start++){printf("%c\n",arr[start]);}}intmain(){chararr[]="
分类:
其他好文 时间:
2020-10-22 23:03:54
阅读次数:
28
#include <iostream> #include <cstring> using namespace std; char a[260]; int main() { int len,k; cin>>a; cin>>k; len=strlen(a); while(k--) { for(int i ...
分类:
其他好文 时间:
2020-10-19 22:33:48
阅读次数:
21
1 #pragma once 2 #include <initializer_list> 3 struct String { 4 String(const char*s) { 5 c_str = new char[strlen(s)+1]; 6 while (*s) { 7 *(c_str+sz) ...
分类:
其他好文 时间:
2020-10-18 10:09:18
阅读次数:
18
首先我们难以计算每个在范围内的数对答案的贡献,注意到每个数的贡献组成是线性的,于是可以考虑计算每个数字对答案的贡献。 那么你会发现对于数字 \(d\),当它在所选数中排名(从大到小)为 \(i\) 时对答案的贡献就为 \(d \times 10 ^ {i - 1}\)。 那么现在的问题就转化为求数字 ...
分类:
其他好文 时间:
2020-10-12 19:59:07
阅读次数:
22
这是一道x64的elf逆向题。 先进入主函数,定位到输入输出和一个叫sudoku的全局变量数组: sudoku的意思是数独,所以定位到sudoku数组的位置,将其提出来: 这里我犯了一个错误,这些数据在内存中存储的时候是小端序的int,我提出来以后为了简洁只写了两位,导致我后面分析的时候一直把它当成 ...
分类:
其他好文 时间:
2020-09-18 17:13:51
阅读次数:
38
char * reformatDate(char * date){ int len = strlen(date); int i,j=0; char* str = (char*)calloc(len*2,sizeof(char)); char* arr[] = {"Jan","01","Feb","0 ...
分类:
其他好文 时间:
2020-09-17 20:28:40
阅读次数:
42
char * removeOuterParentheses(char * S){ int len = strlen(S),count=1,n=0; char* ret = (char*)calloc(len,sizeof(char*)); for (int i=1; i<len; i++) { (S ...
分类:
其他好文 时间:
2020-09-17 19:23:34
阅读次数:
21
// 字典树的左儿子右兄弟法 // 相同长度则为 strlen(str)*2 + 2 不同则为 公共前缀 + 1 #include<bits/stdc++.h> #define rep(i, n) for(int i=0;i!=n;++i) #define per(i, n) for(int i=n ...
分类:
其他好文 时间:
2020-09-17 14:15:04
阅读次数:
28