1052 卖个萌,C
作者:互联网
#include <stdio.h>
int main()
{
char hand[10][6]={0},eye[10][6]={0},mouth[10][6]={0},c;
int i=0,n,a1,a2,a3,a4,a5;
while((c=getchar())!='\n')
if(c=='[')
scanf("%[^]]",hand[i++]);
i=0;
while((c=getchar())!='\n')
if(c=='[')
scanf("%[^]]",eye[i++]);
i=0;
while((c=getchar())!='\n')
if(c=='[')
scanf("%[^]]",mouth[i++]);
scanf("%d",&n);
while(n--)
{
scanf("%d %d %d %d %d",&a1,&a2,&a3,&a4,&a5);
a1--;a2--;a3--;a4--;a5--;
if( a1>9 || a1<0 || !(*hand[a1]) ||
a2>9 || a2<0 || !(*eye[a2]) ||
a3>9 || a3<0 || !(*mouth[a3]) ||
a4>9 || a4<0 || !(*eye[a4]) ||
a5>9 || a5<0 || !(*hand[a5]) )
puts("Are you kidding me? @\\/@");
else
printf("%s(%s%s%s)%s\n",hand[a1],eye[a2],mouth[a3],eye[a4],hand[a5]);
}
system("pause");
return 0;
}
标签:1052,scanf,a3,a1,while,a5,卖个,getchar 来源: https://blog.csdn.net/weixin_43916400/article/details/104784555