#import <Foundation/Foundation.h>
typedef struct {
int nian;
int yue;
int ri;
} ShengRi;
typedef enum{
Sexwoman,
Sexman,
} Sex;
@interface XueSheng : NSObject
{ @public
char *name;//名字
ShengRi sr;//生日
int age;//年龄
double shengao;//身高
double tizhong;//体重
Sex sex;//性别
int cyy;//C语言
int oc;//OC语言
int ios;//IOS语言
}
- (void)run;
- (void)eat;
- (void)xuexi;
- (void)shuijiao;
@end
int main()
{
XueSheng *x =[XueSheng new];
x->name = "Jack";
ShengRi d = {1992,7,30};
x -> sr = d;
x -> age = 22;//年龄
x -> shengao = 1.82;//身高
x -> sex = Sexman;
x -> tizhong =75;//体重
x -> cyy =90;//C语言成绩
x -> oc =91;//oc成绩
x -> ios = 95;//ios成绩
return 0;
}
|