delete pics to save space
This commit is contained in:
20
history_source/ccf 入门篇/U4/4.1.4.cpp
Normal file
20
history_source/ccf 入门篇/U4/4.1.4.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
|
||||
int n,b,s,a;
|
||||
cin>>n;
|
||||
cin>>s;
|
||||
b=s+1;
|
||||
for(int i=0;i<n-1;i++)
|
||||
{
|
||||
cin>>a;
|
||||
if(a>b) b=a;
|
||||
else if(a<s) s=a;
|
||||
}
|
||||
cout<<b-s<<endl<<endl;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user