牛客298651911号
牛客298651911号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客298651911号的博客
全部文章
(共4篇)
题解 | 输出单向链表中倒数第k个结点
#include <iostream> #include <unordered_map> using namespace std; struct ListNode { int val; ListNode* next; ListNode(int x)...
2026-05-01
0
15
题解 | 字符串最后一个单词的长度
#include <iostream> using namespace std; #include <string.h> int main() { string s,last; while (cin >> s) { // 注意 while 处理多...
2026-04-28
0
20
题解 | #打印文件的最后5行#
一、tail 【主要从文件的尾部操作查询文件】 1、tail -f nowcoder.txt : 实时输出文件的最新更新内容; 2、tail -n 5 nowcoder.txt [或者:tail -5 nowcoder.txt] : 输出文件的最后5行; 3、tail -n +5 ...
2022-09-03
3
750
题解 | #统计文件的行数#
我们运用wc -l来统计文件的行数 采用标准输入和标准输出,通过管道的方式 “ | ” 采用命令“cat”获取文件的内容传给wc -l命令 #!/bin/bash cat nowcoder.txt | wc -l
2022-09-03
2
837