好吧,这是错误,我尝试读取每个不同的名称,但我不能只读取其他名称
This is what happens, what's the error?
int main(void)
{
// Variables declaration
int i, j, n, len;
char names[25][100];
// The amount of names
printf("enter the number of names: ");
scanf("%i", &n);
// Scanning all the names
for (i = 0; i < n; i++)
{
printf("name %i: ", i+1);
gets(names[i]);
}
// Upper them
for (i = 0; i < n; i++)
{
for (j = 0, len = strlen(names[i]); j < len; j++)
{
names[i][j] = toupper(names[i][j]);
}
}
// Printing them
for (i = 0; i < n; i++)
{
printf("name %i: %s\n", i+1, names[i]);
}
}