天梯赛31-35

#include<stdio.h>
#include<math.h>
int a[10];
int main()
{
	int n,a,b;
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d%d",&a,&b);
		double c=(a-100)*0.9*2;
		if(fabs(b-c)<c*0.1)
		{
			printf("You are wan mei!\n");
		}
		else if(b>0.9*c)
		{
			printf("You are tai pang le!\n");
		}
		else if(b<=0.9*c)
		{
			printf("You are tai shou le!\n");
		}
	}
	return 0;
}
#include<stdio.h>
#include<string.h>
int main()
{
    int n;
    char b,a[100005];
    scanf("%d %c",&n,&b);
    getchar();
    scanf("%[^\n]",a);
    int l=strlen(a);
    if(n<l)
    {
        for(int i=l-n;i<l;i++)
        {
            printf("%c",a[i]);
        }
    }
    else if(n==l)
        printf("%s",a);
    else
    {
        for(int i=0;i<n-l;i++)
        {
            printf("%c",b);
        }
        printf("%s",a);
    }
    return 0;
}
#include<stdio.h>
int shuzi(int n)
{
    int t=0,a[10]={0};
    if(n<1000)
        a[0]++;
    while(n)
    {
        int k=n%10;
        a[k]++;
        n/=10;
    }
    for(int i=0;i<10;i++)
    {
        if(a[i]!=0)
            t++;
    }
    return t;
}
int main(){
    int m,n,t=0;
    scanf("%d %d",&m,&n);
    while(shuzi(m)!=n)
    {
        m++;
        t++;
    }
    printf("%d %04d",t,m);
    return 0;
}
#include<stdio.h>
int main()
{
    int n,a[1005]={0};
    scanf("%d",&n);
    while(n--)
    {
        int t,b;
        scanf("%d",&t);
        while(t--)
        {
            scanf("%d",&b);
            a[b]++;
        }
    }
    int x=0,y=0;
    for(int i=1000;i>0;i--)
    {
        if(a[i]>x)
        {
            x=a[i];
            y=i;
        }
    }
    printf("%d %d",y,x);
    return 0;
}
#include<stdio.h>
#include<string.h>
int main()
{
    char a[10005],b[10005],s[10005];
    int x=0;
    while(1)
    {
        scanf("%s",s);
        if(s[0]=='.')
            break;
        x++;
        if(x==2){strcpy(a,s);}
        if(x==14){strcpy(b,s);}
    }
    if(x>=14)
        printf("%s and %s are inviting you to dinner...",a,b);
    else if(x>=2&&x<14)
        printf("%s is the only one for you...",a);
    else
        printf("Momo... No one is for you ...");
    return 0;
}

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值