初学指针,望指点,这个程序本应实现的功能是输入罗马数字,输出相应的阿拉伯数字,该怎么改??
#include<stdio.h>#include<string.h>
int main()
{
char s1[12][5]={"I","II","III","IV","V","VI","V","VII","VIII","IX","X","XI","XII"};
char (*p)[12]=s1[0],s2,j;
int i=0;
scanf("%s",s2);
for(i=0;i<12;i++)
for(j=0;j<=4;j++)
{
if(strcmp(s2,*(*(p+i)+j))==0)
{
printf("%d",i+1);
break;
}
else
*p++;
}
return 0;
}