第一天
OC的文件后缀名为.m(message)的意思,
第一个程序hello
world
:
打印函数NSLog();和C语言和c++的区别是,它会自动换行。
#import
:包含系统的头文件。和C语言的#include
类似,但是,他会自动判断是否已经被包含,而C语言中需要用#ifndef #endif来进行管理:
定义一个类:
包含两个文件...
分类:
其他好文 时间:
2015-08-11 21:33:47
阅读次数:
139
/*
* handle.h
*/
#ifndef HANDLE_H_
#define HANDLE_H_
#include "msgqueue.h"
typedef struct HANDLER{
int send_sock;
char send_ip[128];
uint16 send_port;
int ind;
pthread_t th...
分类:
其他好文 时间:
2015-08-11 21:33:11
阅读次数:
153
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1068
#include
#include
#include
using namespace std;
int n;
int used[505];
int link[505][505];
int boy[505];
int find(int x){
int i;
f...
分类:
其他好文 时间:
2015-08-11 21:28:32
阅读次数:
154
如题,下面直接贴出代码:#include using namespace std;int Partition(int* A,int left,int right){ int key=A[left]; while(left=key) right--; i...
分类:
编程语言 时间:
2015-08-11 21:25:10
阅读次数:
129
需要补充。。1. 注意虚函数的指针占4个字节。(当然是32位机器)#include #include #include #include using namespace std;class A {public: const int a;};class B {};class C {public:...
分类:
编程语言 时间:
2015-08-11 21:23:35
阅读次数:
126
主题链接:http://poj.org/problem?id=1320题目大意:求解两个不相等的正整数N、M(N#include#include#includeusing namespace std;int main(){ int x,y,x1,y1,px,py,d; x1 = px =...
分类:
其他好文 时间:
2015-08-11 21:19:45
阅读次数:
106
SD集训divisors题目大意:给定一个1~n的排列p,求l#include#include#include#define maxnode 200005using namespace std;struct use{ int l,r,po;}ask[maxnode]={0},bei[40000...
分类:
其他好文 时间:
2015-08-11 21:17:12
阅读次数:
122
1 #ifndef _SINGLETON_H_ 2 #define _SINGLETON_H_ 3 #include 4 5 template 6 class CSingleton 7 { 8 private: 9 CSingleton(){} //构造函数是私有的10 publi...
分类:
编程语言 时间:
2015-08-11 21:16:47
阅读次数:
165
简单模拟题,可以利用一下能被11整除的数的特点:奇数位的数字和与偶数位的数字和之差能被11整除。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int N = 1000000; 8 ...
分类:
其他好文 时间:
2015-08-11 21:15:37
阅读次数:
91
http://acm.hdu.edu.cn/showproblem.php?pid=1012分析:就按题目给的公式一步步输出就行了。 1 #include 2 #include 3 #include 4 int main() 5 { 6 double e; 7 printf("n e...
分类:
其他好文 时间:
2015-08-11 21:12:43
阅读次数:
176