+86 15680936349
2019-12-31 16:17
采纳率: 50%
浏览 128

PTAchar a[][]总提示段错误

#include
#include
int main()
{
char a[100][100], b[100] = {"z"};
int i, n;
scanf("%d", &n);
for (i = 0; i < n; i++)
{
scanf("%s",&a[i]);
if (strcmp(b, a[i]) > 0)
{
strcpy(b, a[i]);
}
}
printf("Min is: % s", b);
return 0;
}

1条回答 默认 最新