![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
华为
anieoo
这个作者很懒,什么都没留下…
展开
-
牛客HJ7
【代码】牛客HJ7。原创 2023-02-01 12:36:47 · 349 阅读 · 0 评论 -
牛客HJ6
divide循环中的i一定是质数,因为如果是合数一定可以分解成比它小的质数,在循环到i前之前已经被分解完毕。原创 2023-01-22 20:57:23 · 226 阅读 · 0 评论 -
牛客HJ5
读取字符串,从后往前处理。原创 2023-01-22 20:41:34 · 225 阅读 · 0 评论 -
牛客HJ4
原题链接:字符串分隔_牛客题霸_牛客网solution:先将输入的字符串补0,再按每8个字符进行保存#include <iostream>using namespace std;#include <string>#include <vector>string str;vector<string> strnums;int main(){ cin>>str; int n = str.size();.原创 2022-05-15 19:48:58 · 103 阅读 · 0 评论 -
牛客HJ2
原题链接:计算某字符出现次数_牛客题霸_牛客网solution: 只需要注意处理字符串输入的方法就好了 处理完输入,遍历一遍字符串#include <iostream>#include <cstring>using namespace std;const int N = 1010;char str[N]; //输入的字符串char s; //求解的字符int cnt = 0;int main(){ ...原创 2022-05-15 15:13:42 · 86 阅读 · 0 评论 -
牛客HJ1
原题链接:字符串最后一个单词的长度_牛客题霸_牛客网solution: 逐个读入输入的字符,遇到空格数量清0,遇到换行符号就跳出循环#include <iostream>#include <cstring>using namespace std;int main() { char ch; int cnt = 0; while((ch = getchar()) != '\n') { if(ch == '...原创 2022-05-15 12:26:21 · 108 阅读 · 0 评论