#include <iostream>
#include <string.h>
#include <ctype.h>
using namespace std;
static char answer[3][10];// = {"Accepted","Presentation Error","Wrong Answer"};
static int g_count =1;//测试数据编号
//a是正确答案
//b是用户输入的答案
//判断是否是数字
int isdigitSum(char a[])
{
int sum = 0;
for (int i = 0;i < strlen(a);++i)
{
if (isdigit(a[i]))
{
sum += a[i]-'0';
}
}
return sum;
}
int Automated_Judge_Script(char a[],char b[])
{
if (strlen(a) == strlen(b))
{
if (strcmp(a,b) == 0)
{
return 0;
}
}
if (isdigitSum(a) == isdigitSum(b))
{
return 1;
}
return 2;
}
void printAnsewer(int n)
{
printf("Run #%d:%s\n",g_count++,answer[n]);
}
int main(int argc, const char * argv[])
{
strcpy(answer[0], "Accepted");
strcpy(answer[1], "Presentation Error");
strcpy(answer[2], "Wrong Answer");
char a[20];
char b[20];
strcpy(a,"qwe120");
strcpy(b,"qwe120");
printAnsewer(Automated_Judge_Script(a,b));
strcpy(a,"qwe120");
strcpy(b,"1 2 0");
printAnsewer(Automated_Judge_Script(a,b));
strcpy(a,"qwe120");
strcpy(b,"1 0");
printAnsewer(Automated_Judge_Script(a,b));
return 0;
}