随笔分类 -  面试编程题

网易笔试题
摘要:(1)小易有一个古老的游戏机,上面有着经典的游戏俄罗斯方块。因为它比较古老,所以规则和一般的俄罗斯方块不同。荧幕上一共有 n 列,每次都会有一个 1 x 1 的方块随机落下,在同一列中,后落下的方块会叠在先前的方块之上,当一整行方块都被占满时,这一行会被消去,并得到1分。有一天,小易又开了一局游戏, 阅读全文
posted @ 2018-08-22 23:01 Mini_Coconut 阅读(452) 评论(0) 推荐(0)
阿里巴巴在线笔试题——第一象限坐标点中,原点处能看到的个数
摘要:#include <iostream>#include <vector>#include <algorithm>using namespace std;class stu{public: int x; int y; float slope;};int main(){ int s; cin>>s; i 阅读全文
posted @ 2018-03-24 17:31 Mini_Coconut 阅读(326) 评论(0) 推荐(0)
输入一个字符串,判断最后一个单词的长度
摘要:第一个版本,只考虑了简单的情况,未考虑全部是空格,连续好几个空格,空格在最后,空格在开头的种种情况 #include<iostream>#include <string>using namespace std;int main(){ string s; getline(cin,s); int tot 阅读全文
posted @ 2018-03-23 21:23 Mini_Coconut 阅读(548) 评论(0) 推荐(0)