蓝欧--lesson4

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    
    
    
    //循环语句
    //while循环
//    int a = 0, b = 0;
//    while (a < 10) {       //死循环
//        printf("%d", a);
//    }
//    
    
//        int a = 0, b = 0;
//        while (a < 10) {
//            printf("%d", a);
//            a++;
//            
//        }
//    printf("第%d次.", a);
//}
    
    
//    int a =0;
//    while (a <=5) {
//        printf("%d", a);
//        a++;
//    }
//}
  //打印1--100
//    int a = 1;
//    while (a <= 100) {
//        printf("%d\n", a);
//        a++;
//    }
//}
    
//    //打印100--1
//    int a =100;
//    while (a > 0) {
//        printf("a = %d\n", a);
//        a--;
//    }
//    
//}
    
    //计算1+2+3....+99 = 4950
    
//    int i = 1, sum = 0;
//    while (i < 100) {
//        sum += i;
//        i++;
//    }
//    printf("sum = %d", sum);
//}
    
    //打印0--100的偶数
//    int a = 0;
//    while (a < 100) {
//        printf("%d", a);
//        a += 2;
//    }
//    
//}
    
      //打印0--100的偶数
//    int a = 0;
//    while (a <= 100) {
//        if (a % 2 == 0) {
//            printf("%d", a);
//            
//        }
//        a ++;
//    }
//}

//打印0--100的奇数
//        int a = 0;
//        while (a <= 100) {
//            if (a % 2 != 0) {
//                printf("%d\n", a);
//    
//            }
//            a ++;
//        }
//    }
  //打印0--100的奇数
    
//    int a = 1;
//    while (a < 100) {
//        printf("%d\n", a);
//        a +=2;
//    }
//}

//    
//        int a = 1, sum = 0;
//        while (a < 100) {
//            sum += a;
//            
//            a +=2;
//        }printf("%d\n", sum);
//    }
    //个位为7
//    int a = 0;
//    while (a < 100) {
//        a +=7;
//        printf("%d", a);
//    }
//}

//    int a = 0;
//    while (a < 100) {
//        
//        if (a % 7 == 0) {
//            printf("%d", a);
//        }
//        a ++;
//    }
//    
//}

//    int a = 0;
//    while (a < 100) {
//        if (a % 10 ==7) {
//            printf("%d", a);
//        }
//        a ++;
//    }
//}

//    int a = 0;
//    while (a <100) {
//        if (a / 10 ==7){
//            printf("%d", a);
//        }a ++;
//    }
//}

//    int a = 0;
//    while (a < 100) {
//        if (a % 10 ==7 || a /10 ==7){
//            printf("%d\n", a);
//        }a ++;
//    }
//}
    
    
//        int a = 0;
//        while (a < 100) {
//            if (a % 7 !=0 && a /10 !=7 && a % 10 != 7){
//                printf("%d\n", a);
//            }a ++;
//        }
//    }

//arc4random()随机数函数,用用得到一个随机数
    //得到0-X的随机数,arc4random() % (X + 1)
    //得到[x, y]区间的数,arc4random()%(y-x+1)+x
    
//    int a = 0;
//    while (a <= 100) {
//        unsigned int i = arc4random() % 101;
//        printf("%d\n", i);
//        a ++;
//    }
//}

//    int a = 1;
//    while (a < 100) {
//        unsigned int b = arc4random() % (50-14+1)+14;
//        printf("%u\n", b);
//        a ++;
//    }
//}
    
//    //得到N个[50-100]的随机数
//    int i = 1;
//    int n = 0;
//    printf("输入N的个数:");
//    scanf("%d", &n);
//    while (i <= n) {
//        unsigned int  number = arc4random() % 51 + 50;
//        printf("随机数%u\n", number);
//        i ++;
//    }
//}

//用户从控制台输入一个n,用while打印n个随机数(范围为30~70), 找出n个随机数中的最大值
//    int n = 0;
//    int i = 1;
//    int max = 0;
//    printf("请输入n:");
//    scanf("%d", &n);
//    while (i <= n) {
//        unsigned int num = arc4random() % 41 + 30;
//        printf("第%d的随机数:%d\n", i,num);
//        //每出来一个随机数都和当前的max比较
//        //如果出来的时候随机数比max更大,给max重新给值
//        if (num > max) {
//            max = num;
//        }
//        i ++;
//    }printf("最大的数是:%d", max);
//}
 
        //do...while循环
//    int i = 0;
//    do{
//        printf("i = %d\n",i);
//        i ++;
//    }while (i <=100);
//}
    
//    int i = 1;
//    do {
//        printf("i = %d\n", i);
//        i ++;
//    } while (i <= 100);
//}

//    int num = 0, count = 0;
//    printf("请输入一个数:");
//    scanf("%d", &num);
//    do {
//         count ++;
//      num = num / 10;
//       
//    } while (num != 0);
//    
//    printf("count = %d", count);
//}

//    int num = 0, count = 0;
//    printf("please:");
//    scanf("%d", &num);
//    do {
//        count ++;
//        num = num / 10;
//            } while (num != 0);
//    printf("%d",count);
//}

//for(循环变量给初值; 循环条件; 循环变量步长) 循环

//    for (int i = 1; i <=100; i++) {
//        printf("i = %d", i);
//    }
//}
//    for (int i = 100; i > 0; i--) {
//        printf("i = %d\n",i);
//    }
//}
//    for (int i = 0; i <= 100; i += 2) {
//        printf("%d", i);
//    }
//}

//    for (int i = 1; i < 100; i++) {
//        if (i % 7 == 0) {
//            printf("7的倍数%d\n", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++) {
//        if (i % 10 ==7) {
//            printf("个位数是7的有:%d\n", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++) {
//        if (i / 10 == 7) {
//            printf("十位数是7的:%d", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++){
//        if (i % 7 !=0 && i / 10 !=7 && i % 10 != 7 ) {
//            printf("%d\n", i);
//        }
//    
//    }
//}

//    int i= 0;
//    for (; i < 100; ) {
//        printf("%d", i);
//        i++;
//    }
//}

//    for (int i = 1,j = 1; i <= 9 && j <= i ; i++,j++) {
//        printf("%d * %d =%d", i, j ,i*j);
//    }
//}
//
     //循环嵌套
    
    
//    for (int i = 1; i <= 3; i++) {
//        for (int j = 1; j <= 4; j++) {
//            printf("%2d",j);
//        }printf("\n");
//    }
//}

//外成循环每执行一次,内成循环执行一遍
    //外成循环控制行数
    //内成循环控制列数
//        for (int i = 1; i <= 4; i++) {
//            for (int j = 1; j <= i; j++) {
//                printf("%-2d",j);
//            }printf("\n");
//        }
//    }

//九九乘法表
//    for (int i = 1; i <= 9; i++) {
//        for (int j = 1; j <= i; j++) {
//            printf("%d * %d = %d ", i, j, i*j);
//        }printf("\n");
//    }
//}

//    for (int i = 1; i < 10; i++) {
//        for (int j = 1; j <= i; j++) {
//            printf("%d * %d = %d ", i, j,i*j);
//        }printf("\n");
//    }
//}
   
    //打印三个数字(0 - 9)的组合可能(组合成三位数)

//    for (int i = 0; i <= 9; i++) {
//        for (int j = 0; j <= 9; j++) {
//            for (int k = 0; k <= 9; k++) {
//                printf("%d,%d,%d ", i, j, k);
//            }printf("\n");
//        }
//    }
//}

//break(作用)用于跳出本层循环,用于提前结束循环,通常配合if语句使用
//    for (int i = 0; i < 9; i++) {
//        for (int  j = 0; j<9; j++) {
//            if (j == 5){
//                break;
//            }
//            printf("i = %d",j);
//        }
//        printf("hello,world\n");
//    }
//}
    
    //continue(作用)用于结束本次循环,continue后面的代码不再执行),进入下次循环。(通常与if连)
//    for (int i = 0;i <=100; i++){
//    if(i % 2 != 0){
//        continue;
//    }
//        printf("i = %d", i);
//    }
//}

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    
    
    
    //循环语句
    //while循环
//    int a = 0, b = 0;
//    while (a < 10) {       //死循环
//        printf("%d", a);
//    }
//    
    
//        int a = 0, b = 0;
//        while (a < 10) {
//            printf("%d", a);
//            a++;
//            
//        }
//    printf("第%d次.", a);
//}
    
    
//    int a =0;
//    while (a <=5) {
//        printf("%d", a);
//        a++;
//    }
//}
  //打印1--100
//    int a = 1;
//    while (a <= 100) {
//        printf("%d\n", a);
//        a++;
//    }
//}
    
//    //打印100--1
//    int a =100;
//    while (a > 0) {
//        printf("a = %d\n", a);
//        a--;
//    }
//    
//}
    
    //计算1+2+3....+99 = 4950
    
//    int i = 1, sum = 0;
//    while (i < 100) {
//        sum += i;
//        i++;
//    }
//    printf("sum = %d", sum);
//}
    
    //打印0--100的偶数
//    int a = 0;
//    while (a < 100) {
//        printf("%d", a);
//        a += 2;
//    }
//    
//}
    
      //打印0--100的偶数
//    int a = 0;
//    while (a <= 100) {
//        if (a % 2 == 0) {
//            printf("%d", a);
//            
//        }
//        a ++;
//    }
//}

//打印0--100的奇数
//        int a = 0;
//        while (a <= 100) {
//            if (a % 2 != 0) {
//                printf("%d\n", a);
//    
//            }
//            a ++;
//        }
//    }
  //打印0--100的奇数
    
//    int a = 1;
//    while (a < 100) {
//        printf("%d\n", a);
//        a +=2;
//    }
//}

//    
//        int a = 1, sum = 0;
//        while (a < 100) {
//            sum += a;
//            
//            a +=2;
//        }printf("%d\n", sum);
//    }
    //个位为7
//    int a = 0;
//    while (a < 100) {
//        a +=7;
//        printf("%d", a);
//    }
//}

//    int a = 0;
//    while (a < 100) {
//        
//        if (a % 7 == 0) {
//            printf("%d", a);
//        }
//        a ++;
//    }
//    
//}

//    int a = 0;
//    while (a < 100) {
//        if (a % 10 ==7) {
//            printf("%d", a);
//        }
//        a ++;
//    }
//}

//    int a = 0;
//    while (a <100) {
//        if (a / 10 ==7){
//            printf("%d", a);
//        }a ++;
//    }
//}

//    int a = 0;
//    while (a < 100) {
//        if (a % 10 ==7 || a /10 ==7){
//            printf("%d\n", a);
//        }a ++;
//    }
//}
    
    
//        int a = 0;
//        while (a < 100) {
//            if (a % 7 !=0 && a /10 !=7 && a % 10 != 7){
//                printf("%d\n", a);
//            }a ++;
//        }
//    }

//arc4random()随机数函数,用用得到一个随机数
    //得到0-X的随机数,arc4random() % (X + 1)
    //得到[x, y]区间的数,arc4random()%(y-x+1)+x
    
//    int a = 0;
//    while (a <= 100) {
//        unsigned int i = arc4random() % 101;
//        printf("%d\n", i);
//        a ++;
//    }
//}

//    int a = 1;
//    while (a < 100) {
//        unsigned int b = arc4random() % (50-14+1)+14;
//        printf("%u\n", b);
//        a ++;
//    }
//}
    
//    //得到N个[50-100]的随机数
//    int i = 1;
//    int n = 0;
//    printf("输入N的个数:");
//    scanf("%d", &n);
//    while (i <= n) {
//        unsigned int  number = arc4random() % 51 + 50;
//        printf("随机数%u\n", number);
//        i ++;
//    }
//}

//用户从控制台输入一个n,用while打印n个随机数(范围为30~70), 找出n个随机数中的最大值
//    int n = 0;
//    int i = 1;
//    int max = 0;
//    printf("请输入n:");
//    scanf("%d", &n);
//    while (i <= n) {
//        unsigned int num = arc4random() % 41 + 30;
//        printf("第%d的随机数:%d\n", i,num);
//        //每出来一个随机数都和当前的max比较
//        //如果出来的时候随机数比max更大,给max重新给值
//        if (num > max) {
//            max = num;
//        }
//        i ++;
//    }printf("最大的数是:%d", max);
//}
 
        //do...while循环
//    int i = 0;
//    do{
//        printf("i = %d\n",i);
//        i ++;
//    }while (i <=100);
//}
    
//    int i = 1;
//    do {
//        printf("i = %d\n", i);
//        i ++;
//    } while (i <= 100);
//}

//    int num = 0, count = 0;
//    printf("请输入一个数:");
//    scanf("%d", &num);
//    do {
//         count ++;
//      num = num / 10;
//       
//    } while (num != 0);
//    
//    printf("count = %d", count);
//}

//    int num = 0, count = 0;
//    printf("please:");
//    scanf("%d", &num);
//    do {
//        count ++;
//        num = num / 10;
//            } while (num != 0);
//    printf("%d",count);
//}

//for(循环变量给初值; 循环条件; 循环变量步长) 循环

//    for (int i = 1; i <=100; i++) {
//        printf("i = %d", i);
//    }
//}
//    for (int i = 100; i > 0; i--) {
//        printf("i = %d\n",i);
//    }
//}
//    for (int i = 0; i <= 100; i += 2) {
//        printf("%d", i);
//    }
//}

//    for (int i = 1; i < 100; i++) {
//        if (i % 7 == 0) {
//            printf("7的倍数%d\n", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++) {
//        if (i % 10 ==7) {
//            printf("个位数是7的有:%d\n", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++) {
//        if (i / 10 == 7) {
//            printf("十位数是7的:%d", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++){
//        if (i % 7 !=0 && i / 10 !=7 && i % 10 != 7 ) {
//            printf("%d\n", i);
//        }
//    
//    }
//}

//    int i= 0;
//    for (; i < 100; ) {
//        printf("%d", i);
//        i++;
//    }
//}

//    for (int i = 1,j = 1; i <= 9 && j <= i ; i++,j++) {
//        printf("%d * %d =%d", i, j ,i*j);
//    }
//}
//
     //循环嵌套
    
    
//    for (int i = 1; i <= 3; i++) {
//        for (int j = 1; j <= 4; j++) {
//            printf("%2d",j);
//        }printf("\n");
//    }
//}

//外成循环每执行一次,内成循环执行一遍
    //外成循环控制行数
    //内成循环控制列数
//        for (int i = 1; i <= 4; i++) {
//            for (int j = 1; j <= i; j++) {
//                printf("%-2d",j);
//            }printf("\n");
//        }
//    }

//九九乘法表
//    for (int i = 1; i <= 9; i++) {
//        for (int j = 1; j <= i; j++) {
//            printf("%d * %d = %d ", i, j, i*j);
//        }printf("\n");
//    }
//}

//    for (int i = 1; i < 10; i++) {
//        for (int j = 1; j <= i; j++) {
//            printf("%d * %d = %d ", i, j,i*j);
//        }printf("\n");
//    }
//}
   
    //打印三个数字(0 - 9)的组合可能(组合成三位数)

//    for (int i = 0; i <= 9; i++) {
//        for (int j = 0; j <= 9; j++) {
//            for (int k = 0; k <= 9; k++) {
//                printf("%d,%d,%d ", i, j, k);
//            }printf("\n");
//        }
//    }
//}

//break(作用)用于跳出本层循环,用于提前结束循环,通常配合if语句使用
//    for (int i = 0; i < 9; i++) {
//        for (int  j = 0; j<9; j++) {
//            if (j == 5){
//                break;
//            }
//            printf("i = %d",j);
//        }
//        printf("hello,world\n");
//    }
//}
    
    //continue(作用)用于结束本次循环,continue后面的代码不再执行),进入下次循环。(通常与if连)
//    for (int i = 0;i <=100; i++){
//    if(i % 2 != 0){
//        continue;
//    }
//        printf("i = %d", i);
//    }
//}

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    
    
    
    //循环语句
    //while循环
//    int a = 0, b = 0;
//    while (a < 10) {       //死循环
//        printf("%d", a);
//    }
//    
    
//        int a = 0, b = 0;
//        while (a < 10) {
//            printf("%d", a);
//            a++;
//            
//        }
//    printf("第%d次.", a);
//}
    
    
//    int a =0;
//    while (a <=5) {
//        printf("%d", a);
//        a++;
//    }
//}
  //打印1--100
//    int a = 1;
//    while (a <= 100) {
//        printf("%d\n", a);
//        a++;
//    }
//}
    
//    //打印100--1
//    int a =100;
//    while (a > 0) {
//        printf("a = %d\n", a);
//        a--;
//    }
//    
//}
    
    //计算1+2+3....+99 = 4950
    
//    int i = 1, sum = 0;
//    while (i < 100) {
//        sum += i;
//        i++;
//    }
//    printf("sum = %d", sum);
//}
    
    //打印0--100的偶数
//    int a = 0;
//    while (a < 100) {
//        printf("%d", a);
//        a += 2;
//    }
//    
//}
    
      //打印0--100的偶数
//    int a = 0;
//    while (a <= 100) {
//        if (a % 2 == 0) {
//            printf("%d", a);
//            
//        }
//        a ++;
//    }
//}

//打印0--100的奇数
//        int a = 0;
//        while (a <= 100) {
//            if (a % 2 != 0) {
//                printf("%d\n", a);
//    
//            }
//            a ++;
//        }
//    }
  //打印0--100的奇数
    
//    int a = 1;
//    while (a < 100) {
//        printf("%d\n", a);
//        a +=2;
//    }
//}

//    
//        int a = 1, sum = 0;
//        while (a < 100) {
//            sum += a;
//            
//            a +=2;
//        }printf("%d\n", sum);
//    }
    //个位为7
//    int a = 0;
//    while (a < 100) {
//        a +=7;
//        printf("%d", a);
//    }
//}

//    int a = 0;
//    while (a < 100) {
//        
//        if (a % 7 == 0) {
//            printf("%d", a);
//        }
//        a ++;
//    }
//    
//}

//    int a = 0;
//    while (a < 100) {
//        if (a % 10 ==7) {
//            printf("%d", a);
//        }
//        a ++;
//    }
//}

//    int a = 0;
//    while (a <100) {
//        if (a / 10 ==7){
//            printf("%d", a);
//        }a ++;
//    }
//}

//    int a = 0;
//    while (a < 100) {
//        if (a % 10 ==7 || a /10 ==7){
//            printf("%d\n", a);
//        }a ++;
//    }
//}
    
    
//        int a = 0;
//        while (a < 100) {
//            if (a % 7 !=0 && a /10 !=7 && a % 10 != 7){
//                printf("%d\n", a);
//            }a ++;
//        }
//    }

//arc4random()随机数函数,用用得到一个随机数
    //得到0-X的随机数,arc4random() % (X + 1)
    //得到[x, y]区间的数,arc4random()%(y-x+1)+x
    
//    int a = 0;
//    while (a <= 100) {
//        unsigned int i = arc4random() % 101;
//        printf("%d\n", i);
//        a ++;
//    }
//}

//    int a = 1;
//    while (a < 100) {
//        unsigned int b = arc4random() % (50-14+1)+14;
//        printf("%u\n", b);
//        a ++;
//    }
//}
    
//    //得到N个[50-100]的随机数
//    int i = 1;
//    int n = 0;
//    printf("输入N的个数:");
//    scanf("%d", &n);
//    while (i <= n) {
//        unsigned int  number = arc4random() % 51 + 50;
//        printf("随机数%u\n", number);
//        i ++;
//    }
//}

//用户从控制台输入一个n,用while打印n个随机数(范围为30~70), 找出n个随机数中的最大值
//    int n = 0;
//    int i = 1;
//    int max = 0;
//    printf("请输入n:");
//    scanf("%d", &n);
//    while (i <= n) {
//        unsigned int num = arc4random() % 41 + 30;
//        printf("第%d的随机数:%d\n", i,num);
//        //每出来一个随机数都和当前的max比较
//        //如果出来的时候随机数比max更大,给max重新给值
//        if (num > max) {
//            max = num;
//        }
//        i ++;
//    }printf("最大的数是:%d", max);
//}
 
        //do...while循环
//    int i = 0;
//    do{
//        printf("i = %d\n",i);
//        i ++;
//    }while (i <=100);
//}
    
//    int i = 1;
//    do {
//        printf("i = %d\n", i);
//        i ++;
//    } while (i <= 100);
//}

//    int num = 0, count = 0;
//    printf("请输入一个数:");
//    scanf("%d", &num);
//    do {
//         count ++;
//      num = num / 10;
//       
//    } while (num != 0);
//    
//    printf("count = %d", count);
//}

//    int num = 0, count = 0;
//    printf("please:");
//    scanf("%d", &num);
//    do {
//        count ++;
//        num = num / 10;
//            } while (num != 0);
//    printf("%d",count);
//}

//for(循环变量给初值; 循环条件; 循环变量步长) 循环

//    for (int i = 1; i <=100; i++) {
//        printf("i = %d", i);
//    }
//}
//    for (int i = 100; i > 0; i--) {
//        printf("i = %d\n",i);
//    }
//}
//    for (int i = 0; i <= 100; i += 2) {
//        printf("%d", i);
//    }
//}

//    for (int i = 1; i < 100; i++) {
//        if (i % 7 == 0) {
//            printf("7的倍数%d\n", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++) {
//        if (i % 10 ==7) {
//            printf("个位数是7的有:%d\n", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++) {
//        if (i / 10 == 7) {
//            printf("十位数是7的:%d", i);
//        }
//    }
//}

//    for (int i = 1; i <= 100; i++){
//        if (i % 7 !=0 && i / 10 !=7 && i % 10 != 7 ) {
//            printf("%d\n", i);
//        }
//    
//    }
//}

//    int i= 0;
//    for (; i < 100; ) {
//        printf("%d", i);
//        i++;
//    }
//}

//    for (int i = 1,j = 1; i <= 9 && j <= i ; i++,j++) {
//        printf("%d * %d =%d", i, j ,i*j);
//    }
//}
//
     //循环嵌套
    
    
//    for (int i = 1; i <= 3; i++) {
//        for (int j = 1; j <= 4; j++) {
//            printf("%2d",j);
//        }printf("\n");
//    }
//}

//外成循环每执行一次,内成循环执行一遍
    //外成循环控制行数
    //内成循环控制列数
//        for (int i = 1; i <= 4; i++) {
//            for (int j = 1; j <= i; j++) {
//                printf("%-2d",j);
//            }printf("\n");
//        }
//    }

//九九乘法表
//    for (int i = 1; i <= 9; i++) {
//        for (int j = 1; j <= i; j++) {
//            printf("%d * %d = %d ", i, j, i*j);
//        }printf("\n");
//    }
//}

//    for (int i = 1; i < 10; i++) {
//        for (int j = 1; j <= i; j++) {
//            printf("%d * %d = %d ", i, j,i*j);
//        }printf("\n");
//    }
//}
   
    //打印三个数字(0 - 9)的组合可能(组合成三位数)

//    for (int i = 0; i <= 9; i++) {
//        for (int j = 0; j <= 9; j++) {
//            for (int k = 0; k <= 9; k++) {
//                printf("%d,%d,%d ", i, j, k);
//            }printf("\n");
//        }
//    }
//}

//break(作用)用于跳出本层循环,用于提前结束循环,通常配合if语句使用
//    for (int i = 0; i < 9; i++) {
//        for (int  j = 0; j<9; j++) {
//            if (j == 5){
//                break;
//            }
//            printf("i = %d",j);
//        }
//        printf("hello,world\n");
//    }
//}
    
    //continue(作用)用于结束本次循环,continue后面的代码不再执行),进入下次循环。(通常与if连)
//    for (int i = 0;i <=100; i++){
//    if(i % 2 != 0){
//        continue;
//    }
//        printf("i = %d", i);
//    }
//}

时间: 2024-11-08 04:51:28

蓝欧--lesson4的相关文章

蓝欧--lesson8

#import <Foundation/Foundation.h>//       宏名 替换的内容[千万别加分号]#define VALUE 10 //命名规范,纯大写或者是k开头的驼峰命名法#define AS 52.02 #define SUM(A, B) A + B #define SQUARE(A) ((A) + (A))//安全 #define MAXXX(A, B) (((A) > (B)) ? (A) : (B)) #define MAX_NUMBER(A, B, C)

蓝欧h5课程笔记

1.获取css外部样式表的属性值 getCss(obj,'属性名称');如:getCss(oSpan[0],'height'); getComputedStyle(obj).属性名称;如:getComputedStyle(oDiv[0]).width; 2响应式布局 <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0

蓝欧证件照

蓝欧--lessonc12[函数指针]

#import <Foundation/Foundation.h> //int(*)(int ,int) 原类型//PFUN 新类型typedef int(*PFUN)(int ,int); typedef struct student{    char name[20];    char sex;    int age;    float score;}STUDENT; BOOL sortByAge(STUDENT stu, STUDENT stu1);BOOL sortByAge(STUD

蓝欧--lesson2

#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) {                //变量定义三要素    //类型修饰符 变量名 =初始值            //变量命名规范:    //1.变量名必须以字母,数字,下划线组成,数字不能打头    //2.变量名不能够占用系统关键字    //3.见名知意    //4.驼峰命名法        //    int a = 5;//   

蓝欧--lessonc11[动态内存分配]

#import <Foundation/Foundation.h>#import "header.h" typedef struct student{    char name[20];    char sex;    int  age;    float score;    }STUDENT; int maxValue(int a, int b);int square(int n); char * getString(); int maxValue(int a, int

蓝欧培训 c7

header.m#import "header.h" void printStudent(STUDENT boy){    printf("%-11s %d %d-%d-%d %c %.2f\n",boy.name,boy.age,boy.birthday.year,boy.birthday.month,boy.birthday.day, boy.sex,boy.score); } void printAllStudents(STUDENT stus[],int c

蓝欧--lesson5&lt;有难度&gt;

#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { //输出数组中4个数的最大数//    int i = 0, max = 0,a[4] = {0};//    printf("请输入四个数:");//    for (i = 0; i<4; i++) {//        scanf("%d", &a[i]);//    }//    m

蓝欧--lesson3

#import <Foundation/Foundation.h>////int main(int argc, const char * argv[]) { //    //    //溢出//    char a = 128;//    //    printf("%d", a);//        //无符号类型,值存正数    //%u 打印无符号整型数    //%lu 打印无符号长整型数    //%ld 打印有符号长整型数//    unsigned char