IOS编程学习笔记
1 @interface 2 -实例对象 3 +类名 4 5 #import "MyClass" 6 7 @implementation MyClass 8 -(id)initWithString:(NSString*)name 9 { 10 } 11 +() 12 13 14 int max,min; 15 int array[30],sum=0; 16 for(int i=0;i<30;i++) 17 { 18 rand100=(((double)rand()/(double)max)*max+min); 19 array[i]=rand100; 20 sum+=array[i]; 21 } 22 23 不同的鸡兔吃的东西多少不一样,而每次有不一样 24 25 26 27 #include<iostream> 28 using namespace std; 29 30 int main() 31 { 32 int a[5] = { 1, 5, 7, 9, 25 }, b[5] = { 1, 27, 26, 38, 99 }; 33 int *c = new int; 34 int k=4,j=4; 35 for (int i = 0; i < 10; i++) 36 { 37 if (a[j] > b[k]) 38 { 39 c[i] = a[j]; 40 j--; 41 } 42 else 43 { 44 c[i] =b[k]; 45 k--; 46 } 47 } 48 for (int i = 0; i < 10; i++) 49 cout << c[i] << " "; 50 } 51 52 53 return self=C语言中的*this 54 55 if(self) 56 { 57 power=0; 58 } 59 return self;