1

#include <iostream>
using namespace std;

int main()
{

   
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << c << ' ' << d;

    return 0;
}

2

#include <iostream>
using namespace std;

int main()
{

   
    double a, b;
    scanf("%lf%lf", &a, &b);
    printf("%.3f%%", b / a * 100);
    return 0;
}

3

#include<bits/stdc++.h>
using namespace std;

int main()
{

   
    int a, b, sum = 0;
    cin >> a >> b;
    if(a < 60)
    {

   
        sum++;
    }
    if(b < 60)
    {

   
        sum++;
    }
    cout << (sum == 1 ? 1 : 0) << endl;
    return 0;
}

4

#include<bits/stdc++.h>
using namespace std;

int main()
{

   
    int k, cnt1 = 0, cnt5 = 0, cnt10 = 0;
    cin >> k;
    for(int i = 0; i < k; i++)
    {

   
        int x;
        cin >> x;
        switch(x)
        {

   
            case 1:
            {

   
                cnt1++;
                break;
            }
            case 5:
            {

   
                cnt5++;
                break;
            }
            case 10:
            {

   
                cnt10++;
                break;
            }
            default:
                break;
        }
    }
    cout << cnt1 << endl << cnt5 << endl << cnt10 << endl;
    return 0;
}

5

#include<bits/stdc++.h>
using namespace std;

int main()
{

   
    int k, day = 1, cnt = 0, coincnt = 0;
    cin >> k;
    while(cnt < k)
    {

   
         cnt += day;
         day++;
    }
    for(int i = 1; i < day; i++)
    {

   
        coincnt += i * i;
    }
    cout << coincnt - ((cnt - k) * (day - 1)) << endl;
    return 0;
}

==============================
长按识别二维码加好友获取此次考试真题回忆版邀请进信息学竞赛群
全国青少年软件编程等级考试C语言(一级)真题 2020年第三季度参考代码-LMLPHP

09-14 09:16