PPT Slide
// Read in the grades and make up array f
int i= 0;
// Inv: i grades have been read in and
// each f[k], for 0<=k<=100, contains
// the no. of times grade k was read in
while (i != f.length) {
int grade= Integer.parseInt(stdin.readLine() );
f[grade]= f[grade] + 1;
i= i+1;
}
Previous slide
Next slide
Back to first slide
View graphic version