import java.util.*;
import java.io.*;
public class AvgNums {
int count=0;
double sum= 0.0;
fout.write("2 3.4 5 6 7.4 9.1 10.5 готово");
fout.close();
Scanner src = new Scanner(fin);
while(src.hasNext()) {
if(src.hasNextDouble()) {
sum += src.nextDouble();
count++;
}
}
if(src.hasNext()) {
if(str.equals("готово"))
{
return;
}
else {
System.
out.
println("Ошибка формата файла."); return;
}
}
src.close();
System.
out.
println("средне равно: " +sum
/count
); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5pby4qOwoKCnB1YmxpYyBjbGFzcyBBdmdOdW1zIHsKcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nIGFyZ3NbXSl0aHJvd3MgSU9FeGNlcHRpb24gewoKaW50IGNvdW50PTA7Cgpkb3VibGUgc3VtPSAwLjA7CgoKRmlsZVdyaXRlciBmb3V0ID0gbmV3IEZpbGVXcml0ZXIoInRlc3QudHh0Iik7CmZvdXQud3JpdGUoIjIgMy40IDUgNiA3LjQgOS4xIDEwLjUg0LPQvtGC0L7QstC+Iik7CmZvdXQuY2xvc2UoKTsKRmlsZVJlYWRlciBmaW4gPSBuZXcgRmlsZVJlYWRlcigidGVzdC50eHQiKTsKU2Nhbm5lciBzcmMgPSBuZXcgU2Nhbm5lcihmaW4pOwoKCndoaWxlKHNyYy5oYXNOZXh0KCkpIHsKaWYoc3JjLmhhc05leHREb3VibGUoKSkgewpzdW0gKz0gc3JjLm5leHREb3VibGUoKTsKU3lzdGVtLm91dC5wcmludGxuKHN1bSk7CmNvdW50Kys7Cn0KfQppZihzcmMuaGFzTmV4dCgpKSB7ClN0cmluZyBzdHIgPSBzcmMubmV4dCgpOwoKaWYoc3RyLmVxdWFscygi0LPQvtGC0L7QstC+IikpCnsKcmV0dXJuOwp9CmVsc2UgewpTeXN0ZW0ub3V0LnByaW50bG4oItCe0YjQuNCx0LrQsCDRhNC+0YDQvNCw0YLQsCDRhNCw0LnQu9CwLiIpOwpyZXR1cm47Cn0KfQoKc3JjLmNsb3NlKCk7ClN5c3RlbS5vdXQucHJpbnRsbigi0YHRgNC10LTQvdC1INGA0LDQstC90L46ICIgK3N1bS9jb3VudCk7Cn0KfQ==