标题: 这个程序哪里错了呢? [打印本页] 作者: lala 时间: 2009-11-5 00:42 标题: 这个程序哪里错了呢? 题目是:定义一个结构体变量(包括数值和花色),编程加52张扑克牌赋值,并将13张黑桃输出显示:
下面是我写的:
#include<iostream.h>
#include<string.h>
class puke
{
char huase[20];
char shuzhi[20];
public:
void shuru(int n);
void shuchu(int n);
}puke[52];
void puke::shuru(int n)
{
switch(n%4)
{case 0:strcmp(huase,"hongtao");break;
case 1:strcmp(huase,"heitao");break;
case 2:strcmp(huase,"meihua");break;
case 3:strcmp(huase,"caohua");break;
}
switch(n/4)
{case 0:strcmp(shuzhi,"3");break;
case 1:strcmp(shuzhi,"3");break;
case 2:strcmp(shuzhi,"3");break;
case 3:strcmp(shuzhi,"3");break;
case 4:strcmp(shuzhi,"3");break;
case 5:strcmp(shuzhi,"3");break;
case 6:strcmp(shuzhi,"3");break;
case 7:strcmp(shuzhi,"3");break;
case 8:strcmp(shuzhi,"3");break;
case 9:strcmp(shuzhi,"3");break;
case 10:strcmp(shuzhi,"3");break;
case 11:strcmp(shuzhi,"3");break;
case 12:strcmp(shuzhi,"3");break;