合作者 :何宇恒:031692113;http://www.cnblogs.com/hyh1072797231/
姚志辉:031602142;http://www.cnblogs.com/52wu244/
代码(失败代码)https://github.com/xiaozhirensan/object-oriented/tree/master
我的部分
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
void topic(int n,int randn[],int key[],char randc[]);
int judge(int key[],int keym[],int n);
int randn[4],key[100],keym[100],i,n;
char randc[3];
printf("please enter a number of topics:");
scanf("%d",&n);
topic(n,randn,key,randc);
for(i=0;i<n;i++)
scanf("%d",&keym[i]);
judge(key,keym,n);
return(0);
}
int caculate(char c,int a,int b)
{
int i=-1;
while(1)
{
if(c=='/'&&a%b!=0)continue;
switch(c)
{
case'+':i=a+b;break;
case'-':i=a-b;break;
case'*':i=a*b;break;
case'/':i=a/b;break;
}
}
return(i);
}
void judge(int key[],int keym[],int n)
{
int a=0,b=0,i;
for(i=0;i<n;i++)
{
if(key[i]==keym[i])a++;
else b++;
}
printf("the number of correct answers is:%d
",a);
printf("the number of wrong answers is:%d",b);
}