#include #include #include unsigned int arr[16384]; unsigned int getcpm(int sec) { int t; unsigned int t1=0; for(t=0;t<60;t++)t1+=arr[sec+t]; return t1; } int main() { FILE *f; char s[256],s1[256],s2[256]; long t=0,t1,t2; long secs=0; f=fopen("cps.lst","r"); while(!feof(f)){ fgets(s,250,f); arr[secs]=atoi(s); //printf(" %i:%i:%s",secs,arr[secs],s); secs++; } fclose(f); for(t=0;t<(secs/10)-7;t++) { printf("%i %i\n",t*10,getcpm(t*10)); } return 0; }