![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
牛客网刷题
xhlbetter
这个作者很懒,什么都没留下…
展开
-
牛客网 坐标移动
#include<bits/stdc++.h> using namespace std; int main() { //加快cin的效率 ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); string s,t; while(getline(cin,s)) { stringstream ss(s); pair<int,int> p(0,0原创 2022-05-13 09:47:58 · 94 阅读 · 0 评论 -
牛客网 HJ2 计算某字符出现次数
#include<bits/stdc++.h> using namespace std; int main() { string str; char ch; getline(cin,str); ch = tolower(getchar()); int count = 0; for(auto c : str) { if(tolower(c)==ch) { count++;原创 2022-05-07 09:42:34 · 342 阅读 · 0 评论 -
牛客网刷题总结-HJ1 字符串最后一个单词的长度
#include<bits/stdc++.h> using namespace std; int main(){ string str; while(cin >> str); cout << str.size(); return 0; } 简单总结: 1、#include<bits/stdc++.h>包含了目前c++所包含的所有头文件,是个万能库。 2、cin遇到回车与空格结束读取 ...原创 2022-05-06 17:16:13 · 271 阅读 · 0 评论