解题思路:结构体
注意事项:
参考代码:
#include<stdio.h>
#include<string.h>
struct hdjvh{
char a[100];
char b[100];
char c[100];
}p[10000];
int main()
{
int s[100];
scanf("%s",s);
int n,i,j,cnt=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s %s %s",p[i].a,p[i].b,p[i].c);
}
for(i=0;i<n;i++)
{
if(strcmp(s,p[i].c)==0)
{
char temp[100]={0};
strcpy(temp,p[i].b);
for(j=0;j<strlen(temp);j++)
{
if(temp[j]>='A'&&temp[j]<='Z')
{
temp[j]+=32;
} else if(temp[j]>='a'&&temp[j]<='z')
{
temp[j]-=32;
}
}
printf("%s %s\n",p[i].a,temp);
} else cnt++;
}
if(cnt==n) printf("empty");
return 0;
}
0.0分
1 人评分
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:640 |
WU-蓝桥杯算法提高VIP-Quadratic Equation (C++代码)浏览:1742 |
wu-理财计划 (C++代码)浏览:827 |
WU-整除问题 (C++代码)浏览:611 |
Wu-求圆的面积 (C++代码)浏览:1883 |
Tom数 (C语言代码)浏览:525 |
多输入输出练习2 (C语言代码)浏览:1655 |
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:984 |
拆分位数 (C语言代码)浏览:441 |
C语言程序设计教程(第三版)课后习题6.7 (C语言代码)浏览:695 |