2021级天梯赛ZZULI 1.1-1.8

1-1 你好,天梯赛

#include<stdio.h>
int main(){
    
    printf("Hello, Tian Ti Sai!"); 
    return 0;
}

1-2 天梯赛考场

#include<iostream>

using namespace std;
int main(){

    int a,b;
    cin>>a>>b;
    cout<<a*b;


    return 0;
}

1-3 《算法竞赛 · 进阶指南》

#include<iostream>

using namespace std;
int main(){
    
  char a;
    cin>>a;
   if(a=='I')
       cout<<"2147483647";
    if(a=='L')
       cout<<"9223372036854775807";
    return 0;
}

1-4 《AK》

#include<iostream>

using namespace std;
int main(){
    
   int a;
    cin>>a;
    if(a%2==0&&a<=100&&a>0)
    {   
        cout<<"YES"<<endl;
    for(int i=1;i<=a;i++)
        if(i%2==1)
            cout<<"A";
     else
         cout<<"K";
    }
    else
        cout<<"NO";
    
    
    return 0;
}

1-5 天鸟火炮

#include<iostream>

using namespace std;
int main(){
    
    double T,a,b,c;
    cin>>T;
    while(T--){
        cin>>a>>b>>c;
        if(a*c/100.0<=b)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
        
        
    }
    return 0;
}

1-6 《从你的全世界路过》

#include<iostream>
using namespace std;
int ikun(int a, int b) {

    if (a != 1 && b == 1) return 1;
    if (b % a != 0 || (a == 1 && b != 1)) return 0;
    else {
        while (b % a == 0) {
            if (a == 1 || b == 1) return 1;
            b = b / a;
        }
        if (b == 1) return 1;
        else return 0;
    }
}
int main()
{
    int a, b;
    scanf("%d%d", &a, &b);
    if (ikun(a, b))
        printf("YES");
    else
        printf("NO");
    return 0;
}

1-7 《双城之战》

#include<iostream>
using namespace std;
int main()
{
    char a[1100], b[1100];
    int n, i=0, c, j=0, flag, d;
    gets(a);
    c=strlen(a);
    scanf("%d", &n);
    getchar();
    while(n--)
    {
 
        flag=0;
        gets(b);
        d=strlen(b);
        if(c==d)
        {
            for(i=0;i<c;i++)
            {
                if(a[i]==b[i])
                    flag=1;
                else
                {
                    flag=0;
                    break;
                }
             }
            j++;
        }
        else
            j++;
        if(flag==1)
                break;
    }
    printf("%d", j);
    return 0;
}

1-8 “这个世界不需要守望先锋”

#include<iostream>
using namespace std;
int main () 
{
    long long n; 
    scanf("%lld", &n);
    long long sum = n * 25 + 250;
    if(sum%20>0)
    printf("%lld", sum / 20+1);
    else
           printf("%lld", sum / 20);
    return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值