摘要: const b = [{index:5,name:"s5"}, {index:2,name:"s2"}, {index:3,name:"s3"}, {index:1,name:"s1"}, {index:8,name:"s8"}]; var a = [], i; for (var i = 0; i < b.length; i++) { var num = b[i].index; a[nu... 阅读全文
posted @ 2016-09-22 16:55 levyleo 阅读(362) 评论(0) 推荐(0) 编辑
摘要: struct TS { int index; char name[10]; }; struct TS b[5] = {{5,"s5"},{2,"s2"},{3,"s3"},{1,"s1"},{8,"s8"}}; struct TS a[11]; int i; int length = sizeof... 阅读全文
posted @ 2016-09-22 15:54 levyleo 阅读(253) 评论(0) 推荐(0) 编辑
摘要: import Foundation let b:Array = [5,2,3,1,8] var a:NSMutableArray = [] for var i in 0 ..= 0){ a[index] = a[index] as! (NSInteger) + 1; } else { a[index] = 0 } } for var i i... 阅读全文
posted @ 2016-09-22 15:24 levyleo 阅读(159) 评论(0) 推荐(0) 编辑
摘要: NSArray * b = @[@5,@2,@3,@1,@8]; NSMutableArray *a = @[].mutableCopy; for (int i=0; i0){ NSLog(@"%d",i); } } 阅读全文
posted @ 2016-09-22 14:38 levyleo 阅读(156) 评论(0) 推荐(0) 编辑
摘要: const b = [5, 2, 3, 1, 8]; var a = [], i; for (var i = 0; i < b.length; i++) { var num = b[i]; a[num] = a[num]||0; a[num] ++; num == null; } for (var i = 0; i < a.length; i+... 阅读全文
posted @ 2016-09-22 14:13 levyleo 阅读(197) 评论(0) 推荐(0) 编辑
摘要: #include int main() { int b[5] = {5,2,3,1,8}; int a[11],i; int length = sizeof(a) / sizeof (int); for(i=0;i= 0){ a[num] ++; }else{ a[num] = 0; ... 阅读全文
posted @ 2016-09-22 13:59 levyleo 阅读(168) 评论(0) 推荐(0) 编辑