4thirteen2one
4thirteen2one
全部文章
分类
题解(37)
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
TA的专栏
1篇文章
0人订阅
我的刷题记录
1篇文章
353人学习
全部文章
(共38篇)
题解 | #HJ102 字符统计#
C语言版本 #include <stdio.h> #include <string.h> int main() { char string[1001]; scanf("%s", string); int length = strlen(string)...
C
Python3
2022-04-28
3
869
题解 | #HJ106 字符串逆序#
C语言版本 #include <stdio.h> #include <string.h> int main() { char content[10001]; int length; scanf("%[^\n]", content, &leng...
C
Python3
2022-04-17
1
1069
题解 | #HJ8 合并表记录#
Python 版本 n = int(input()) table = {} for i in range(n): k, v = map(int, input().split(' ')) if k in table: table[k] += v else: ...
Python3
C
2022-04-17
10
2567
题解 | #HJ17 坐标移动#
Python+正则表达式 import re s = input() mvs = [mv for mv in s.split(';') if re.match(r"^([AWSD]\d{1,2})?$", mv)] x, y = 0, 0 for mv in mvs: if mv: ...
Python3
C
2022-04-17
0
285
题解 | #HJ46 截取字符串#
C语言版本 思路:调用 string.h 中的 strncpy #include <stdio.h> #include <string.h> int main() { char string[1000]; scanf("%s", string); i...
C
Python3
2022-04-17
9
1105
题解 | #HJ10 字符个数统计#
思路:创建128大小的数组,标记出现过的字符,然后统计标记个数 #include <stdio.h> #include <stdbool.h> int main() { bool flags[128] = {false}; char string[500];...
C
2022-04-16
8
750
题解 | #HJ3 明明的随机数#
题目有说明输入数据的大小范围为 [1, 500] 所以可以记录输入数据中的最大值,建立以最大值为长度的数组,从小到大标记有数的元素,即可从小到大输出不重复的数 #include <stdio.h> int main() { int n; scanf("%d", &...
C
2022-04-16
5
1180
题解 | #HJ5 进制转换#
三种方法 以十六进制数读入,以十进制数输出 调用 strtol 转换 自己手动算 #include <stdio.h> #include <math.h> #define FLAG 1 #if FLAG int func1(char hexStr[]) { i...
C
2022-04-16
5
1542
首页
上一页
1
2
3
4
下一页
末页