美团前端暑期实习笔试-3.11
为什么前端要考数据库、操作系统和linux呢
编程题第一题
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>> s;
int res = 0;
int cnt = 1;
int i = 1;
while(i < s.length()) {
if(s[i] == s[i - 1]) {
while(s[i] == s[i - 1]) {
i ++;
cnt ++;
}
} else {
res += cnt/2;
cnt = 1;
}
}
cout << res << endl;
}
第二题差分过了36%,怎么就没想到离散化呢
?为什么一个前端会离散化呢?
#我的实习求职记录#
编程题第一题
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>> s;
int res = 0;
int cnt = 1;
int i = 1;
while(i < s.length()) {
if(s[i] == s[i - 1]) {
while(s[i] == s[i - 1]) {
i ++;
cnt ++;
}
} else {
res += cnt/2;
cnt = 1;
}
}
cout << res << endl;
}
第二题差分过了36%,怎么就没想到离散化呢
#我的实习求职记录#
全部评论
我当时也蒙了哈哈哈,还以为前端会考点html css js三大件的内容,谁知道他是一题也不考啊
相关推荐