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 在西安交通大学的宣讲会,结束时,有一道智
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
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 写道:
>
> 大概是你错了
> 第一个16进制数字是69,第3行第3个也是69,如果直接翻译的话,这两个应当是
好像应该为:
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 在西安交通大学宣讲会上的智力题