当前位置:网站首页>Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball
Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball
2022-07-04 02:34:00 【This question AC sleep again】
//
problem F: Smallest ball
The time limit : 1.000 Sec Memory limit : 128 MB
Title Description
Xiaohua is a cat who loves table tennis very much , Recently, it sneaked into the closed training ground of the Chinese table tennis team ( In preparation for the war 2017 World Table Tennis Championships in Germany , The Chinese men's team is in Shenzhen , The women's team is in Huangshi, Hubei , Conduct closed training separately ), Secretly playing table tennis . Floret found that the size of these balls is not exactly the same , It's a slight difference in size , After playing for a long time, it found that the smallest one was the most fun . Now Xiaohua wants to know the smallest of a pile of table tennis balls with known diameters .
Input
There are two lines of input data , The first line is a positive integer n, Indicates the number of table tennis balls . The second line is n Floating point types ( Two digits after the decimal point ), Represents the diameter of each ball d( In millimeters ), Numbers are separated by a space ,1<=n<=100,40<=d<41.
Output
The output has only one floating-point type per line , Represents the diameter of the smallest ball , Still keep two decimal places .
The sample input Copy
5
40.03 40.02 40.01 40.04 40.05
Sample output Copy
40.01
Tips
The diameter of the smallest ball is 40.01, So the answer is 40.01.//
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i;
double temp,ans;
while( ~scanf("%d%lf",&n,&ans) )
{
for( i=0;i<n-1;i++ )
{
scanf("%lf",&temp);
if( temp<ans ) ans=temp;
}
printf("%.2lf\n",ans);
}
return 0;
}边栏推荐
- The "two-way link" of pushing messages helps app quickly realize two-way communication capability
- Comment la transformation numérique du crédit d'information de la Chine passe - t - elle du ciel au bout des doigts?
- Solve the problem that the tabbar navigation at the bottom of vantui does not correspond to the page (window.loading.hash)
- VRRP+BFD
- Data collection and summary
- Question d: Haffman coding
- Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
- Career development direction
- Problems and solutions of several concurrent scenarios of redis
- Johnson–Lindenstrauss Lemma
猜你喜欢

Introduction to graphics: graphic painting (I)

Yyds dry goods inventory override and virtual of classes in C

AI 助力藝術設計抄襲檢索新突破!劉芳教授團隊論文被多媒體頂級會議ACM MM錄用

Pytoch residual network RESNET

Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference

Small program graduation project based on wechat examination small program graduation project opening report function reference

What is the student party's Bluetooth headset recommendation? Student party easy to use Bluetooth headset recommended

LV1 previous life archives

Applet graduation project based on wechat selection voting applet graduation project opening report function reference

Example 072 calculation of salary it is known that the base salary of an employee of a company is 500 yuan. The amount of software sold by the employee and the Commission method are as follows: Sales
随机推荐
C language black Technology: Archimedes spiral! Novel, interesting, advanced~
Small program graduation project based on wechat e-book small program graduation project opening report function reference
Life cycle of instance variables, static variables and local variables
Create real-time video chat in unity3d
Sword finger offer 14- I. cut rope
C learning notes: C foundation - Language & characteristics interpretation
[untitled]
Save Private Ryan - map building + voltage dp+deque+ shortest circuit
I stepped on a foundation pit today
MySQL advanced (Advanced) SQL statement (I)
17. File i/o buffer
Global and Chinese market of small batteries 2022-2028: Research Report on technology, participants, trends, market size and share
Example 073 square sum value judgment programming requires the input of a and B, if a ²+ b ² If the result of is greater than 100, a is output ²+ b ² Value, otherwise output the result of a + B.
VRRP+BFD
Talking about custom conditions and handling errors in MySQL Foundation
false sharing
A fan summed up so many interview questions for you. There is always one you need!
A. ABC
MySQL workbench use
Keep an IT training diary 055- moral bitch