zoukankan      html  css  js  c++  java
  • 我的扑克牌

    main.m文件:

    #import <Foundation/Foundation.h>

    #import "hearts.h" #import "spade.h"

    #import "wintersweet.h"

    #import "diamonds.h" #import "stdio.h"

    #import "string.h"

    int main(int argc, const char * argv[])

    {

    spade *m1=[spade alloc];

    hearts *m2=[hearts alloc];

    wintersweet *m3=[wintersweet alloc];

    diamonds *m4=[diamonds alloc];

    [m1 assignmentone];

    [m2 assignmenttwo];

    [m3 assignmentthree];

    [m4 assignmentfour];

    for(int i=0;i<13;i++)

    {

    printf("%s %s %d ",p1[i]->color,p1[i]->number,p1[i]->bigorsmall);

    }

    for(int i=0;i<13;i++)

    {

    printf("%s %s %d ",p2[i]->color,p2[i]->number,p2[i]->bigorsmall);

    }

    for(int i=0;i<13;i++)

    {

    printf("%s %s %d ",p3[i]->color,p3[i]->number,p3[i]->bigorsmall);

    }

    for(int i=0;i<13;i++)

    {

    printf("%s %s %d ",p4[i]->color,p4[i]->number,p4[i]->bigorsmall);

    }

    return 0;

    }

    diamonds.h文件:

    #import <Foundation/Foundation.h>

    @interface diamonds : NSObject

    {

    @public char color[10];

    int bigorsmall; char number[3];

    }

    -(void)assignmentfour;

    @end

    diamonds * p4[13];

    diamonds.m文件:

    #import "diamonds.h"

    #import "string.h"

    #import "stdio.h"

    @implementation diamonds

    -(void)assignmentfour;

    {

    int i=0;

    for(;i<13;i++)

    {

    p4[i]=[diamonds alloc];

    p4[i]->bigorsmall=i+1;

    strcpy(p4[i]->color, "diamonds");

    }

    for(i=0;i<7;i++)

    {

    *(p4[i]->number)=i+3+'0';

    }

    strcpy(p4[7]->number,"10");

    *(p4[8]->number)='J';

    *(p4[9]->number)='Q';

    *(p4[10]->number)='K';

    *(p4[11]->number)='A';

    *(p4[12]->number)='2';

    }

    @end wintersweet.h文件:

    #import <Foundation/Foundation.h>

    @interface wintersweet : NSObject

    {

    @public char color[10];

    int bigorsmall; char number[3];

    }

    -(void)assignmentthree;

    @end

    wintersweet * p3[13];

    wintersweet.m文件:

    #import "diamonds.h"

    #import "string.h"

    #import "stdio.h"

    @implementation diamonds

    -(void)assignmentfour;

    {

    int i=0;

    for(;i<13;i++)

    {

    p4[i]=[diamonds alloc];

    p4[i]->bigorsmall=i+1;

    strcpy(p4[i]->color, "diamonds");

    }

    for(i=0;i<7;i++)

    {

    *(p4[i]->number)=i+3+'0';

    }

    strcpy(p4[7]->number,"10");

    *(p4[8]->number)='J';

    *(p4[9]->number)='Q';

    *(p4[10]->number)='K';

    *(p4[11]->number)='A';

    *(p4[12]->number)='2';

    }

    @end

    heart.h:

    #import <Foundation/Foundation.h>

    @interface hearts : NSObject

    {

    @public char color[10];

    int bigorsmall;

    char number[3];

    }

    -(void)assignmenttwo;

    @end

    hearts * p2[13];

    heart.m:

    #import "hearts.h"

    #import "string.h"

    #import "stdio.h"

    @implementation hearts

    -(void)assignmenttwo;

    {

    int i=0;

    for(;i<13;i++)

    {

    p2[i]=[hearts alloc];

    p2[i]->bigorsmall=i+1;

    strcpy(p2[i]->color, "hearts");

    }

    for(i=0;i<7;i++)

    {

    *(p2[i]->number)=i+3+'0';

    }

    strcpy(p2[7]->number,"10");

    *(p2[8]->number)='J';

    *(p2[9]->number)='Q';

    *(p2[10]->number)='K';

    *(p2[11]->number)='A';

    *(p2[12]->number)='2';

    }

    @end

    spade.h:

    #import <Foundation/Foundation.h>

    @interface spade : NSObject

    {

    @public char color[10];

    int bigorsmall;

    char number[3];

    }

    -(void)assignmentone;

    @end

    spade * p1[13];

    spade.m:

    #import "spade.h"

    #import "string.h"

    #import "stdio.h"

    @implementation spade

    -(void)assignmentone;

    {

    int i=0;

    for(;i<13;i++)

    {

    p1[i]=[spade alloc];

    p1[i]->bigorsmall=i+1;

    strcpy(p1[i]->color, "spade");

    }

    for(i=0;i<7;i++)

    {

    *(p1[i]->number)=i+3+'0';

    }

    strcpy(p1[7]->number,"10");

    *(p1[8]->number)='J';

    *(p1[9]->number)='Q';

    *(p1[10]->number)='K';

    *(p1[11]->number)='A';

    *(p1[12]->number)='2';

    }

    @end

  • 相关阅读:
    Codeforces Round #652 (Div. 2) A. FashionabLee(几何)
    轻量应用服务器如何通过修改apache配置文件实现非https的访问多域名到不同子目录程序?
    在Windows环境下使用hexo搭建博客以及部署到gitee / github
    使用WordPress搭建个人手机博客(阿里云)
    访问自己服务器的ip地址
    php环境无法上传文件的解决方法
    SSRF漏洞
    CSRF全家桶(含义,防御,攻击)
    JS实现HTML实体与字符的相互转换
    CentOS系统下载及应用部署
  • 原文地址:https://www.cnblogs.com/yueyuanyueyuan/p/3516686.html
Copyright © 2011-2022 走看看