Français
Ouvrir dans Telegram

Publicationimport java.util.*;

20 février 2025
D
Deloitte | COGNIZANT | IBM | CAPGEMINI
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] arr = new int[N]; for (int i = 0; i < N; i++) { arr[i] = sc.nextInt(); } double avg= 0; int sum = 0; for (int i = 0; i < K; i++) { sum += arr[i]; } avg = (double) sum / K; for (int i = K; i < N; i++) { sum = sum - arr[i - K] + arr[i]; double cur = (double) sum / K; if (cur > avg) { avg = cur; } } System.out.printf("%.2f\n", avg); sc.close(); } } #BIRLASOFT
930 ·

À proximité dans le fil

DDeloitte | COGNIZANT | IBM | CAPGEMINIAmazon exam ✅✅ Contact: @MLCODER2DDeloitte | COGNIZANT | IBM | CAPGEMINIBIRLASOFT CODING ✅✅✅ CONTACT: @MLCODER2
ce message
DDeloitte | COGNIZANT | IBM | CAPGEMINIpublic class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n= sc.nextInt(); int x=sc.nextInt(); int[] arr=new int[n];DDeloitte | COGNIZANT | IBM | CAPGEMINICOGNIZANT EXAM CLEARED ✅✅✅ CONTACT: @MLCODER2
DDeloitte | COGNIZANT | IBM | CAPGEMINIDeloitte | COGNIZANT | IBM | CAPGEMINI@python_java_Coding · canal · Technologie
7 178abonnés451portée moyenne d'une publication
Fil de la communauté Ouvrir dans Telegram

Un fil public ouvert issu de l'index de recherche ChatCrawler — « le Google du Telegram public » ; actualisé à mesure que la communauté est explorée. Les heures sont en UTC.

Contenu public uniquement, API officielle de Telegram. À propos · FAQ · Limites de l'index · Retirer une page · Catalogue · Recherche · Comment nous comptons