#include<stdio.h>
int main(){
int n,m,k;
char x[10];
scanf("%d %s %d %d",&n,&x,&m,&k);
if(n==k)
{
printf("mei you mai %s de\n",x);
}
else if(m==k)
{
printf("kan dao le mai %s de\n",x);
}
else
{
printf("wang le zhao mai %s de\n",x);
}
return 0;
}
#include<stdio.h>
int main()
{
int n,a,b,c;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d %d %d",&a,&b,&c);
if(c==a*b)
{
printf("Lv Yan\n");
}
else if(c==a+b)
{
printf("Tu Dou\n");
}
else
{
printf("zhe du shi sha ya!\n");
}
}
return 0;
}
#include<stdio.h>
int arr[105];
int brr[105];
int main()
{
int n,k,true=0,false=0,cnt=0;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
scanf("%d",&k);
while(k--)
{
true=0;
false=0;
for(int i=0;i<n;i++)
{
scanf("%d",&brr[i]);
if(brr[i]==0)
{
cnt++;
continue;
}
if(arr[i]==brr[i])
{
true++;
}
else
{
false++;
}
}
if(cnt==n)
{
printf("Ai Ya\n");
continue;
}
if(true && false==0)
{
printf("Da Jiang!!!\n");
}
else
{
printf("Ai Ya\n");
}
}
return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
char s[200];
scanf("%s", &s);
int n;
scanf("%d", &n);
int i;
for (i = 0; i < n; i++)
{
int len = strlen(s);
int j = 0, k = 0, m = 0;
char s2[200];
int a = 0, b = 0;
char c1[6], c2[6];
scanf("%d %d %s %s", &a, &b, &c1, &c2);
for (j = a - 1; j < len; j++)
{
if (k < b - a + 1)
{
s2[k] = s[j];
k++;
}
s[j] = s[j + b - a + 1];
}
int flag = 0;
int len1 = strlen(c1);
int len2 = strlen(c2);
for (j = 0; j < len; j++)
{
int start = j, num;
int sum1 = 0, sum2 = 0;
for (num = 0; num < len1; num++)
{
if (s[start] == c1[num])
{
sum1++;
start++;
}
if (sum1 == len1)
{
int q = 0;
for (q = 0; q < len2; q++)
{
if (s[start] == c2[q])
{
sum2++;
start++;
}
if (sum2 == len2)
{
flag = 1;
break;
}
}
}
if (flag == 1)
break;
}
if (flag == 1)
break;
}
if (flag == 1)
{
for (m = len - 1; m >= j + len1 + k; m--)
{
s[m] = s[m - k];
}
int number = 0;
for (number = 0; number < k; number++)
{
s[m - k + 1] = s2[number];
m++;
}
}
else
{
int number = 0;
for (m = len - k; m < len; m++)
{
s[m] = s2[number];
number++;
}
}
}
puts(s);
return 0;
}
#include<stdio.h>
#include<math.h>
int main()
{
int n0,n1,n,min=1000000,x,flag=0;
scanf("%d %d %d",&n0,&n1,&n);
for(int i=2;i<n && i<n0 &&(n-i)<n1;i++)
{
if(n0%i==0 && n1%(n-i)==0)
{
if(min>abs((n0/i)-(n1/(n-i))))
{
flag=1;
min=abs((n0/i)-(n1/(n-i)));
x=i;
}
}
}
if(flag)
{
printf("%d %d",x,n-x);
}
else
{
printf("No Solution");
}
return 0;
}