#import<Foundation/Foundation.h>
@interface Person:NSObject
{@public
int _age;
NSString *_Sex;
NSString *_name;
}
-(void)eat;
-(void)miaoShu:(NSString *)name andHigh:(float)high andWeight:(float)weight;
@end
@implementation Person
-(void)eat{
NSLog(@"崔飞同学喜欢吃羊肉泡馍");
}
-(void)miaoShu:(NSString *)name andHigh:(float)high andWeight:(float)weight{
NSLog(@"姓名:%@,身高:%.2f,体重:%.2f",name,high,weight);
}
@end
int main(){
@autoreleasepool {
Person *PP=[Person new];
PP->_age=25;
[PP eat];
[PP miaoShu:@"崔飞" andHigh:1.76 andWeight:123];
NSLog(@"年龄:%d,未婚",PP->_age);
NSLog(@"家乡:东北莲花沟子乡");
}
return 0;
}
|
|