洛谷P8839~8841题解

P8839

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,c,d;
	cin>>a>>b>>c;
	d=a*0.2+b*0.3+c*0.5;
	cout<<d;
    return 0;
}

P8840

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,c,d;
	cin>>a;
	long long e[a]={0};
	for(int i=0;i<a;i++)
	{
		cin>>b>>c;
		if(c>20)b-=c-20;
		if(c<16)b-=10;
		if(b<=0)cout<<0<<endl;
		else cout<<b<<endl;
	}
    return 0;
}

P8841

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,maxn=0,minn=100001;
    cin>>n;
    int a[n+1];
    for(int i=1;i<=n;i++)
	{
        cin>>a[i];
        maxn=a[i]>maxn?a[i]:maxn;
        minn=a[i]<minn?a[i]:minn;
    }
    for(int i=1;i<=n;i++)
	{
        cout<<floor(((a[i]-minn)/(maxn-minn))*100.0)<<" ";
    }
    return 0;
}

相关推荐

  1. P1234题解

    2024-07-15 10:50:05       32 阅读
  2. P10397题解

    2024-07-15 10:50:05       26 阅读
  3. P10119 题解

    2024-07-15 10:50:05       19 阅读
  4. P1000-P1001题解

    2024-07-15 10:50:05       33 阅读
  5. P8839~8841题解

    2024-07-15 10:50:05       20 阅读
  6. 入门P1000-P1482题解

    2024-07-15 10:50:05       27 阅读
  7. P5483 小A的烦恼 题解

    2024-07-15 10:50:05       68 阅读
  8. P6974 [NEERC2015] Adjustment Office 题解

    2024-07-15 10:50:05       63 阅读
  9. 题解 P9183 [USACO23OPEN] FEB B

    2024-07-15 10:50:05       56 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-15 10:50:05       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-15 10:50:05       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-15 10:50:05       58 阅读
  4. Python语言-面向对象

    2024-07-15 10:50:05       69 阅读

热门阅读

  1. 机器学习-16-分布式梯度提升库XGBoost的应用

    2024-07-15 10:50:05       27 阅读
  2. hot100 | 九、图论

    2024-07-15 10:50:05       26 阅读
  3. day2 上下文Context

    2024-07-15 10:50:05       22 阅读
  4. 重学PyTorch,粗略笔记(一)

    2024-07-15 10:50:05       23 阅读
  5. 序列标注任务 - CRF条件随机场

    2024-07-15 10:50:05       18 阅读
  6. Python 字典(Dict)详解与实战应用

    2024-07-15 10:50:05       22 阅读
  7. 翁恺-C语言程序设计-07-3. 数素数

    2024-07-15 10:50:05       23 阅读
  8. [C++]this指针

    2024-07-15 10:50:05       24 阅读