# include <stdio.h>
# include <string.h>
void main()
{
int n;
char str[2][10];
int i,j;
scanf("%d",&n);
for(i=0;i<n;i++)
gets(str[i]);
for(i=0;i<n;i++)
for(j=0; j<10; j++)
{
if(str[i][j]<='z'&&str[i][j]>='a')
{
str[i][j]=str[i][j]-32;
continue;
}
if(str[i][j]<='Z'&&str[i][j]>='A')
str[i][j]=str[i][j]+32;
}
for(i=0;i<n;i++)
{
puts(str[i]);
printf("\n");
}
}
已经改成这个样子了 但是只能输入一个字符串 肿么办捏
# include <string.h>
void main()
{
int n;
char str[2][10];
int i,j;
scanf("%d",&n);
for(i=0;i<n;i++)
gets(str[i]);
for(i=0;i<n;i++)
for(j=0; j<10; j++)
{
if(str[i][j]<='z'&&str[i][j]>='a')
{
str[i][j]=str[i][j]-32;
continue;
}
if(str[i][j]<='Z'&&str[i][j]>='A')
str[i][j]=str[i][j]+32;
}
for(i=0;i<n;i++)
{
puts(str[i]);
printf("\n");
}
}
已经改成这个样子了 但是只能输入一个字符串 肿么办捏