Test your WebQ -----Opera Software 在西安交通大学宣讲会上的智力题

8 views
Skip to first unread message

zhang

unread,
Oct 31, 2008, 2:13:25 AM10/31/08
to pon...@googlegroups.com
前一阵子去听了Opera Software 在西安交通大学的宣讲会,结束时,有一道智力题,说谁要现场做出来,可以加分。我是没看明白,发到这里,听听大牛的想法。
 
 
                 Test  your  WebQ!
 
          69  66  20  79          6F   75   20   63
          61  6E  20  72          65   61   64   20
          74  65  69  73          20    77   65   20
          77  61  6E  74          20   79    6F  75
 
Are you read to shape the future of the web?

陨落雕

unread,
Oct 31, 2008, 2:25:07 AM10/31/08
to TopLanguage
ASCII码。果然Opera还是只能算二流公司啊。

lxcypp

unread,
Oct 31, 2008, 2:26:07 AM10/31/08
to pon...@googlegroups.com
('i', 'f', ' ', 'y', 'o', 'u', ' ', 'c')

('a', 'n', ' ', 'r', 'e', 'a', 'd', ' ')

('t', 'e', 'i', 's', ' ', 'w', 'e', ' ')

('w', 'a', 'n', 't', ' ', 'y', 'o', 'u')

2008/10/31 陨落雕 <geo...@gmail.com>

lxcypp

unread,
Oct 31, 2008, 2:27:00 AM10/31/08
to pon...@googlegroups.com
如果LZ试过
http://www.pythonchallenge.com/
相信对付这个手到擒来。

2008/10/31 lxcypp <lxc...@gmail.com>

wang feng

unread,
Oct 31, 2008, 2:33:15 AM10/31/08
to pon...@googlegroups.com
$ cat charto.cc
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;

char arr[] = {
0x69, 0x66, 0x20, 0x79, 0x6F, 0x75, 0x20, 0x63,
0x61, 0x6E, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20,
0x74, 0x65, 0x69, 0x73, 0x20, 0x77, 0x65, 0x20,
0x77, 0x61, 0x6E, 0x74, 0x20, 0x79, 0x6F, 0x75
};

int
main ()
{
vector<char> str(arr, arr+33);

copy( str.begin(), str.end(), ostream_iterator<char>(cout, "" ) );

return 0;
}


$$ g++ -o charto charto.cc
$ ./charto
if you can read teis we want you

看来你记错了一个数字
应该是
if you can read this we want you
而不是
if you can read teis we want you

不过我很喜欢这样的题目:)


zhang wrote:
> 前一阵子去听了Opera Software 在西安交通大学的宣讲会,结束时,有一道智

Cao Yi

unread,
Oct 31, 2008, 2:47:33 AM10/31/08
to pon...@googlegroups.com
我的是
Ef you can read teis we want you
第一个字母不一样啊

lxcypp 写道:


> ('i', 'f', ' ', 'y', 'o', 'u', ' ', 'c')
>
> ('a', 'n', ' ', 'r', 'e', 'a', 'd', ' ')
>
> ('t', 'e', 'i', 's', ' ', 'w', 'e', ' ')
>
> ('w', 'a', 'n', 't', ' ', 'y', 'o', 'u')
>

> 2008/10/31 陨落雕 <geo...@gmail.com <mailto:geo...@gmail.com>>
>
> ASCII 码。果然Opera还是只能算二流公司啊。


>
> On Oct 31, 2:13 am, zhang <zhangzh...@gmail.com

Cao Yi

unread,
Oct 31, 2008, 2:50:48 AM10/31/08
to pon...@googlegroups.com
sorry第一个69应该是0x69

public class Hello002 {

public static void main(String[] args) {
char[] str = new char[] { 0x69, 0x66, 0x20, 0x79, 0x6F, 0x75, 0x20,


0x63, 0x61, 0x6E, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74,
0x65, 0x69, 0x73, 0x20, 0x77, 0x65, 0x20, 0x77, 0x61, 0x6E,
0x74, 0x20, 0x79, 0x6F, 0x75 };

for (int i = 0; i < str.length; i++) {
System.out.print(str[i]);
}
}

}

if you can read teis we want you

貌似这里都不屑写Java的,还是post上来吧。

Cao Yi 写道:

wang feng

unread,
Oct 31, 2008, 2:43:42 AM10/31/08
to pon...@googlegroups.com
大概是你错了
第一个16进制数字是69,第3行第3个也是69,如果直接翻译的话,这两个应当是一样的
也就是if的i和teis的i应当是一样的。

lxcypp

unread,
Oct 31, 2008, 2:46:15 AM10/31/08
to pon...@googlegroups.com
试试python challenge吧,足够挑战

2008/10/31 wang feng <wanng...@gmail.com>


不过我很喜欢这样的题目:)




Cao Yi

unread,
Oct 31, 2008, 3:48:48 AM10/31/08
to pon...@googlegroups.com
嗯,是的。第一个69我写成十进制的了,应该是16进制的。
谢谢啊~

wang feng 写道:
>
> 大概是你错了
> 第一个16进制数字是69,第3行第3个也是69,如果直接翻译的话,这两个应当是

heroboy

unread,
Oct 31, 2008, 6:00:55 AM10/31/08
to TopLanguage
Python:
s='''
69 66 20 79 6F 75 20 63
61 6E 20 72 65 61 64 20
74 65 69 73 20 77 65 20
77 61 6E 74 20 79 6F 75 '''
print ''.join(map(lambda x:chr(int(x,16)),s.split()))

if you can read teis we want you

ShellEx

unread,
Oct 31, 2008, 6:03:17 AM10/31/08
to TopLanguage
哈哈

王天一

unread,
Oct 31, 2008, 8:58:36 AM10/31/08
to pon...@googlegroups.com
    看到数字的第一反应就应该是ASCII码和二进制。。。

2008/10/31 ShellEx <5h3...@gmail.com>

李宇杰

unread,
Nov 1, 2008, 9:50:19 AM11/1/08
to TopLanguage
看到几个0x20,很明显是一句英文,有若干单词。
是挺无聊的。呵呵

On 10月31日, 下午8时58分, "王天一" <jacklinshi1...@gmail.com> wrote:
> 看到数字的第一反应就应该是ASCII码和二进制。。。
>
> 2008/10/31 ShellEx <5h3l...@gmail.com>

weily

unread,
Nov 2, 2008, 7:30:12 PM11/2/08
to pon...@googlegroups.com

好像应该为:

                 Test  your  WebQ!

 

          69  66  20  79          6F   75   20   63

          61  6E  20  72          65   61   64   20

          74  68  69  73          20    77   65   20

          77  61  6E  74          20   79    6F  75

 

 


发件人: pon...@googlegroups.com [mailto:pon...@googlegroups.com] 代表 zhang
发送时间: 2008年10月31 14:13
收件人: pon...@googlegroups.com
主题: [TopLanguage] Test your WebQ -----Opera Software 在西安交通大学宣讲会上的智力题

Reply all
Reply to author
Forward
0 new messages