最小的n
This commit is contained in:
@@ -1,18 +1,14 @@
|
|||||||
#include "iostream"
|
#include "iostream"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
//最小的n
|
||||||
|
float s=0,n=1;
|
||||||
int main() {
|
int main() {
|
||||||
int n,a;
|
while (s<5) {
|
||||||
cin >>n;
|
s=s+1/n;
|
||||||
for (int i=0;i<n; i++) {
|
n++;//n=n+1 n+=1
|
||||||
cin>>a;
|
//cout <<s<<"|"<<1.0/n<<"|"<<n<<endl;
|
||||||
if(a%10<=4){
|
|
||||||
cout <<a/10*10<<endl;
|
|
||||||
}else{
|
|
||||||
cout <<a/10*10+10<<endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
cout <<n<<endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user