自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 AppleScript 笔记

appleScript

2015-10-08 12:36:21 538

原创 OC 自带排序方法

1.sortedArrayUsingComparator  //给一个数组排序- (NSArray *)sortedArrayUsingComparator:(NSComparator)cmptr //Returns an array that lists the receiving ordered set’s elements in ascending order, as determine

2015-01-19 11:47:36 767

原创 OC 自带方法 简绍 6 NSSet

1.set  // 集例子        Person * p = [[Person alloc] initWithName:@"阿顺" sex:@"男" age:30];        Person * p1 = [[Person alloc] initWithName:@"啊寿" sex:@"男" age:30];        Person * p2 = [[Pers

2015-01-19 08:55:26 336

原创 OC 自带方法 简绍 5 NSDictionary

1.字典 initWithObjectsAndKeys ; 初始化字典dictionaryWithObjectsAndKeys : 初始化字典dictionaryWithObjects    forKeys:1.1        NSDictionary * dic = [[NSDictionary alloc] initWithObjectsAndKeys:@"m

2015-01-18 21:18:44 375

原创 OC 自带方法 简绍 4 NSMutableArray

1.//NSMutableArray   继承自array 的可变数组NSMutableArray * array = [[NSMutableArray alloc] initWithCapacity:1];// 这个数字代表了数组初始化有n个结构体的内存,若不够,再申请 n 个结构体内存.例子        Person * p = [[Person alloc] initW

2015-01-18 18:05:10 327

原创 OC 自带方法 简绍 3 NSArray

1.initWithObjects   //例子       NSArray * array = [[NSArray alloc] initWithObjects:@"A", @"B",@"C" ,@"D" ,@"E" , nil];NSLog(@"%@", array);//        //arrayWithObjects  是initWithObjects 的便利构

2015-01-17 22:26:26 884

原创 OC 自带方法 简绍 2 NSMutableString

1. NSMutableString   // 可以改变的string+ (NSMutableString *)stringWithCapacity:(NSUInteger)capacity   //NSMutableString * string = [NSMutableString stringWithFormat:@"蓝鸥"];2.appendString   /

2015-01-17 21:36:37 804

原创 OC 自带方法 简绍 1 NSString

1.  initWithFormat   :  初始化一个 NString 类型- (instancetype)initWithString:(NSString *)aString // Returns an NSString object initialized by copying the characters from another given string.例子:int

2015-01-17 19:06:19 589

原创 利用OC类和可变数组制作简单的通讯录(基于控制台)

//1.新建一个TelBook类//TelBook .h#import NSMutableArray * arr ;@interface TelBook : NSObject{    NSString * _name;    NSString * _sex;    NSString * _tel;    NSString * _address;    N

2015-01-16 09:19:52 314

原创 优化冒泡排序

//    int a[10] = {0};//    BOOL needAgin = YES;       //先初始化还要继续排序//    for (int i = 0; i //        a[i] = arc4random() % 10;// 随机赋值//    }//    for (int i = 0; i //        needAgin = NO;

2015-01-11 20:17:07 272

原创 冒泡排序和选择排序

//    int a[] = {3 , -9 , 32 , 77 , 63 , -24 , 14 , 0 , 21 , 45};//    for (int i = 0; i //        for (int j = 0; j //            if (a[j] //                int cup = a[j];//               

2015-01-11 20:03:29 310

原创 ACM 会场安排问题 最简单的解法

/*会场安排问题   ACM  第一行有1 个正整数k,表示有k 个待安排的活动。接下来的k 行中,每行有2 个正整数,分别表示k 个待安排的活动开始时间和结束时间。时间以0 点开始的分钟计。     希望使用尽可能少的会场.  设计算法求出 需要的最少会场数.    */        // 这道题有很多种做法, 最流行的时贪心算法    // 但我发现了一个 特殊的做法 ,

2015-01-10 22:19:50 533

原创 C 中 & | ~ ^ 与 或 反 异或 的用法

//按位与 & , 有 0 为 0 , 全1 为 1    //作用 : 把某些二进制位清零, 需要清零的给 0 与 , 需要保留的给 1  与;    int a = 0b00000011;    int b = 0b00000010;    int c = a & b;    printf("%d\n", c);//下图是运行结果    //按位或

2015-01-10 22:16:07 661

转载 const 的用法

//const 用来修饰一个变量不能被修改//    const int a = 8;//    printf("%d", a);//    //const 修饰数组, 数组里面的每一个元素都不能修改//    const int array[3] = {1, 6, 8};//    //array[1] = 2; // zzz修改会提示报错//        //

2015-01-10 21:49:51 281

原创 交换两个数字最好的方法 C

// 异或 ^                          相同取0 不同 取 1;int a = 6 , b = 8;    a = a ^ b;    b = a ^ b;    a = a ^ b;    printf("%d %d", a, b);// 比较容易理解的是下面的一种方法    int a = 6 , b = 8;    int c =

2015-01-08 22:46:02 325

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除