系列文章《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
Codeforces 1430G Yet Another DAG Problem 题意 $n$个点$m$条边的有向无环图,每条边有边权$w_i$,现在让你给每个点一个点权$a_v$,对于第$i$条边$(x,y)$,写上一个数字$b_i=a_x-a_y$并且$a_x>a_y$,使得$\sum_^w_i ...
分类:
其他好文 时间:
2020-10-22 22:21:13
阅读次数:
29
#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
//第一次尝试:#include<stdio.h> int main() { int arr[] = { 1,2,3,4,5,6,7 };//查找6 int left = 0; int right = sizeof(arr) / sizeof(arr[0]) - 1; //printf("%d\n" ...
分类:
其他好文 时间:
2020-10-19 22:32:05
阅读次数:
15
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
#简述: 给定序列,查询是否存在全部符合给定种类至少给定此种类数量的区间,并输出最小值 #解法: 氵题,当我知道T4是最简单的题但我选择了硬肛T1之后: 我在写尺取法 2min later,我写完尺取法了 几乎是尺取法板子,即同时移动左右指针,看是否存在合法序列,开个桶随便搞搞就行 不会尺取法的可以 ...
分类:
其他好文 时间:
2020-10-18 10:04:32
阅读次数:
16
近日在做项目时,需要将查询查来的数据在richTextBox里面分行显示,但是richTextBox默认的行间距很小,显示的数据看着很挤,视觉效果差,后查找资料,发现通过以下方法能设置richTextBox的行间距。 using System.Runtime.InteropServices; 里面粘 ...
首先我们难以计算每个在范围内的数对答案的贡献,注意到每个数的贡献组成是线性的,于是可以考虑计算每个数字对答案的贡献。 那么你会发现对于数字 \(d\),当它在所选数中排名(从大到小)为 \(i\) 时对答案的贡献就为 \(d \times 10 ^ {i - 1}\)。 那么现在的问题就转化为求数字 ...
分类:
其他好文 时间:
2020-10-12 19:59:07
阅读次数:
22
// // Created by liu on 2020/10/7. // #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdio.h>struct Node { int id; int *data; } ...
分类:
其他好文 时间:
2020-10-07 21:19:07
阅读次数:
30