1.判断一个数是否为整数 if(m==(int)m)
2.#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
scanf("%d%d",&n,&m);
int a[n];
float count = 0;
for(int i = 0; i < n; i++){
scanf("%d",&a[i]);
}
for(int j = 0; j < n-m; j++){
int temp = 0;
int k = j;
while(k < j+m){
temp += a[k];
k++;
}
if(temp > count){
count = temp;
}
}
float res = count/m;
if(res == int(res)){
printf("%d",res);
}else{
printf("%d/%d",int(count),m);
}
return 0;
}