黑马程序员技术交流社区
标题: oc基础 坐标计算之main.n [打印本页]
作者: linexs 时间: 2015-11-23 15:32
标题: oc基础 坐标计算之main.n
//
// main.m
//
//
// Created by Darin on 15/11/21.
// Copyright © 2015年 darin. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "XYpoint.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
// NSLog(@"Hello, World!");
XYpoint *tmp1 = [XYpoint new];
[tmp1 setX:3];
[tmp1 setY:4];
NSLog(@"XYpoint->_x = %d ,XYpoint->_y = %d ;\n",[tmp1 getX],[tmp1 getY]);
XYpoint *tmp2 = [XYpoint new];
[tmp2 setX:6];
[tmp2 setY:8];
NSLog(@"XYpoint->_x = %d ,XYpoint->_y = %d ;\n",[tmp2 getX],[tmp2 getY]);
NSLog(@"tmpXYpoint->_x = %d ,tmpXYpoint->_y = %d ;\n",[[tmp1 distance:tmp2] getX],[[tmp1 distance:tmp2] getY]);
}
return 0;
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) |
黑马程序员IT技术论坛 X3.2 |