如果打算进米国那些top 10软件公司,刷完这些题,可以增加极大的成功系数
其中一题(好像有类似的问题在这里问过,算智力题)
--------------------------------------------------------------------------------
CTRL+A, CTRL+C, CTRL+V
Imagine you have a special keyboard with the following keys:
A
Ctrl+A
Ctrl+C
Ctrl+V
where CTRL+A, CTRL+C, CTRL+V each acts as one function key for “Select All”, “Copy”, and “Paste” operations respectively.
If you can only press the keyboard for N times (with the above four keys),
please write a program to produce maximum numbers of A. If possible, please also print out the sequence of keys.
--------------------------------------------------------------------------------
申明一下,这个不是什么大公司的网站,是某些程序员搜集的各个大公司常见的编程技术主题,集中放在一起,让大家自己提交解决方案。
由于题目常常出现于各大技术公司的面试当中,所以很多有志进入这些公司的程序员准程序员都靠“刷”这些题库来准备面试而且卓有成效 -- 所以被称为“红宝书” (当时TOFLE,GRE也有那么两本)
webdriver 写道: |
其中一题(好像有类似的问题在这里问过,算智力题)
--------------------------------------------------------------------------------
CTRL+A, CTRL+C, CTRL+V
Imagine you have a special keyboard with the following keys:
A
Ctrl+A
Ctrl+C
Ctrl+V
where CTRL+A, CTRL+C, CTRL+V each acts as one function key for “Select All”, “Copy”, and “Paste” operations respectively.
If you can only press the keyboard for N times (with the above four keys), please write a program to produce maximum numbers of A. If possible, please also print out the sequence of keys.
--------------------------------------------------------------------------------
|
这是一个递归的问题,估计在20/30行程序能够解决
码农最可悲之处,是觉得自己改变了世界。。。:lol: