我有几个技术讨论群(微信),包含 Java 、 iOS 、 Android 、 Nodejs 等。
/**
* @Author kidon
* @Description 本人的微信号在以下代码中
* */
@Test
public void getMyWeChatNum(){
StringBuffer weChatNum=new StringBuffer();
int[]a={7,2,1,3,9,0,4,6};
int[]b={3,1,0,2,3,4,5,6,7};
for(int i:b){
weChatNum.append(a[i]);
}
System.out.println(weChatNum.toString());
}
1
Ce 2016-08-10 15:03:27 +08:00
第一个拿到号码,呵呵!占个楼层...
|
2
kidon OP 这一小段代码,就是让人目测答案的,没啥人来玩额!
|
3
DT27 2016-08-10 15:08:55 +08:00
不用微信聊天。^^
|
4
lneoi 2016-08-10 15:10:03 +08:00
奇怪 咋都喜欢微信呢
|
5
kidon OP 现在工作的人,不用微信?
|
6
cchange 2016-08-10 15:12:28 +08:00
实际上最好是用 Mail List 可惜现在用的人太少了
|
7
qfdk 2016-08-10 15:13:41 +08:00
不用微信的路过。。。
|
8
popu111 2016-08-10 15:26:23 +08:00 2
不用微信内心平静
|
9
kidon OP 我觉得,不用网络,内心才能真正的平静吧
|
10
liqingcan 2016-08-10 15:29:48 +08:00
不喜欢用微信的路过。微信的打开率没有 qq 和今日头条多。。。。
|
11
ahjsrhj 2016-08-10 15:30:28 +08:00 via Android 1
已加入~
|
12
kidon OP ahjsrhj 是第二位加过来的,有空多交流...
|
13
zhangchioulin 2016-08-10 15:51:52 +08:00 1
方便下 iOS 的工程师,帮忙转了下:
#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... NSArray *a = @[@7,@2,@1,@3,@9,@0,@4,@6]; NSArray *b=@[@3,@1,@0,@2,@3,@4,@5,@6,@7]; NSMutableString *weChatString = [NSMutableString string]; for (NSNumber *i in b) { [weChatString appendFormat:@"%@", a[[i intValue]]]; } NSLog(@"%@", weChatString); } return 0; } |
14
kidon OP zhangchioulin 挺有意思....
|
15
niyuandage 2016-08-10 16:23:25 +08:00
|
16
amon 2016-08-10 16:45:46 +08:00 1
技术群最终都会要么水掉,要么死掉。
上个 js 版的: ``` var a = new Array(7,2,1,3,9,0,4,6); var b = new Array(3,1,0,2,3,4,5,6,7); var t = ''; for(var i=0; i <b.length; i ++){ t = t + '' + a[b[i]]; } alert(t); ``` |
17
Light3 2016-08-10 17:05:52 +08:00 1
function getWeixin(){
$weixin = ''; $a = array(7,2,1,3,9,0,4,6); $i = array(3,1,0,2,3,4,5,6,7); foreach ($i as $v){ $weixin .= $a[$v]; } echo $weixin; } 做为 php 辣鸡的我 .. |
18
dxk611 2016-08-10 17:10:54 +08:00
微信就算了
|
19
kidon OP 非常感谢大家来玩,好多版本额...
|
20
xwartz 2016-08-10 20:25:07 +08:00 1
```js
let a = [7,2,1,3,9,0,4,6] let b = [3,1,0,2,3,4,5,6,7] let weChatNum = '' b.forEach(n => { weChatNum += a[n] }) console.log(weChatNum) ``` |
21
aeshfawre 2016-08-10 21:23:05 +08:00
http://imgur.com/jFlWyDL
是这样玩么? |
22
aeshfawre 2016-08-10 21:24:27 +08:00 1
|
23
jesse_luo 2016-08-10 22:29:55 +08:00 1
Ruby
[3,1,0,2,3,4,5,6,7].map{ |x| [7,2,1,3,9,0,4,6][x]}.join |
24
raidou 2016-08-11 00:13:27 +08:00 1
<?php
$a = [7,2,1,3,9,0,4,6]; $b = [3,1,0,2,3,4,5,6,7]; echo join(array_map(function($i) use($a) { return $a[$i]; }, $b)); elixir a = [7,2,1,3,9,0,4,6] b = [3,1,0,2,3,4,5,6,7] IO.puts(b |> Enum.map(fn(i) -> Enum.at(a, i) end) |> Enum.join) swift let a = [7,2,1,3,9,0,4,6] let b = [3,1,0,2,3,4,5,6,7] print(b.map({(i: Int) -> String in String(a[i])}).joinWithSeparator("")) |
25
kidon OP system.out.println("还有人需要加的么?");
|
26
mubai 2016-08-11 10:02:09 +08:00 1
Groovy
def getMyWeChatNum(){ def a = [7,2,1,3,9,0,4,6] [3,1,0,2,3,4,5,6,7].each{ print a[it] } } |
27
keepcleargas 2016-08-11 11:48:12 +08:00
有点意思 憋了好久 写不出非 Java 语言的,苦逼的 Java 开发 路过
|
28
horsttop 2016-08-11 11:54:53 +08:00
swift
var a=[7,2,1,3,9,0,4,6] var b=[3,1,0,2,3,4,5,6,7] var number = "" for i in b{ number += "\(a[i])" } print(number) |