//
// main.m
// C7 – 结构体多文件
//
// Created by dllo on 15/7/8.
// Copyright (c) 2015年 Gaozi. All rights reserved.
//
import
import “MY Foundation.h”
int main(int argc, const char * argv[]) {
STUDENT STU = {23,"HAHA",90.5};
printStu(STU);
STUDENT temp = STU;
printStu(temp);
// 结构体可以进行直接赋值,但是数组不可以.
STUDENT stu1 = {24,"zhangsan",92};
STUDENT stu2 = {22,"lisi",93};
STUDENT stu3 = {27,"xiaofeng",99};
//找到两人中较好成绩/
// 条件运算符.
float max = 0;
max = stu1.stuscore > stu2.stuscore ? stu1.stuscore : stu2.stuscore;
printf(“%g\n”,max);
// 找到成绩最好的人.
STUDENT temp = stu1.stuscore > stu2.stuscore ? stu1 : stu2;
printStu(temp);
// 调用函数.
STUDENT temp =goodstu(stu1, stu2, stu3);
printStu(temp);
printStu(goodstu(stu1, stu2, stu3));
printf(“%ld”,sizeof(STUDENT));
printf(“%ld”,sizeof(TEXT));
// 找平均年龄
average(stu1, stu2, stu3);
// 两个点是否在一个水平线,是否垂直,是否相等.
cpoint point1 = {10,20};
cpoint point2 = {30,20};
if (judgepoint(point1, point2) == 1){
printf(“在一条水平线上\n”);
}else{
print