//
//main.m
//冰
//
//Created by lanou on 16/10/18.
//Copyright (c) 2016年lanou. All rights reserved.
//
#import
intmain(intargc,constchar* argv[]) {
@autoreleasepool{
// insert code here...
NSLog(@"Hello, World!");
/*
for (NSInteger i = 0; i <= 100; i ++) {
if (i % 7 != 0 && i/10 !=7 && i % 10 != 7) {
NSLog(@"既不是7的倍数,个位数也不是7:%ld",i);
}
}
for (NSInteger i = 10; i <= 30; i++) {
i = arc4random() % 21 + 10;
NSLog(@"随机数:%ld",i);
}
*/
/*第一小题
NSInteger num,i;
for (i=1; i <= 19; i++) {
num = i * (i+1);
NSLog(@"num=%ld",num);
}
*/
/*第二小题
NSInteger num1,i1,num2,i2;
for (i1 =1; i1 <= 100; i1++) {
NSLog(@"%ld %ld",i1,num1);
num1 += i1;
}*/
/*NSInteger num,i;
for (i = 1; i <= 97; i+2) {
i += 2;
num += i;
NSLog(@"%ld %ld",i,num);
}*/
/*
NSInteger num,i;
for (i = 0; i <= 98; i+2) {
i += 2;
num += i;
NSLog(@"%ld %ld",i,num);
}*/
//第三小题:随机产生20个[10 , 100]的正整数,输出这些数以及他们中的最大数。
NSInteger i,j;
//NSInteger max = 10;
//NSInteger min = 100;
/*
for (i = 10; i <= 100; i++) {
i = arc4random();
NSLog(@"%ld",i);
}*/
}
}
return0;
}