wydxry
wydxry
全部文章
题解
归档
标签
去牛客网
登录
/
注册
wydxry的博客
全部文章
/ 题解
(共86篇)
题解 | #记负均正#
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n){ int d; int cnt1=0,cnt2=0; ...
C++
2021-11-12
5
1164
题解 | #输入整型数组和排序标识,对其元素按照升序或降序进行排序#
#include <bits/stdc++.h> using namespace std; int cmp(int a,int b) { return a>=b; } int main() { int a[1005]; int n; int d; ...
C++
2021-11-12
1
431
题解 | #计算某字母出现次数#
#include <bits/stdc++.h> using namespace std; int main() { char c; string str; getline(cin, str); scanf("%c",&c); if(c>=...
C++
2021-11-12
0
369
题解 | #有效括号序列#
class Solution { public: /** * * @param s string字符串 * @return bool布尔型 */ bool isValid(string s) { // write code ...
C++
2021-11-12
1
378
题解 | #编写函数实现两数交换(引用方式)#
#include <iostream> using namespace std; // write your code here...... void swap(int &m,int &n){ int t=m; m=n; n=t; } int ...
C++
2021-11-09
0
494
题解 | #数组中只出现一次的两个数字#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param array int整型vector * @return int整型vecto...
C++
2021-11-08
1
381
题解 | #第一个只出现一次的字符#
class Solution { public: int FirstNotRepeatingChar(string str) { unordered_map<char, int> mp; for(int i=0;i<str.length();...
C++
2021-11-08
1
392
题解 | #替换空格#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @return string字符串 *...
2021-11-08
1
333
题解 | #旋转数组#
class Solution { public: /** * 旋转数组 * @param n int整型 数组长度 * @param m int整型 右移距离 * @param a int整型vector 给定数组 * @return int...
C++
2021-11-08
2
394
题解 | #判断是否为回文字符串#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param str string字符串 待判断的字符串 * @return bool布尔型 *...
C++
2021-11-08
0
289
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页