Skip to content

Instantly share code, notes, and snippets.

@ReticentIris
Created September 7, 2011 22:20
Show Gist options
  • Save ReticentIris/1201975 to your computer and use it in GitHub Desktop.
Save ReticentIris/1201975 to your computer and use it in GitHub Desktop.
public class Gill {
public static void main(String[] args){
int[][] g = {{100, 100, 33, 10}, {80, 80, 80, 80, 80}, {50, 50, 50}, {90, 95, 100, 45}};
for(int n = 0, j = g.length; n < j; n++){
int k = 0, h = g[n].length;
for(int q = 0; q < h; q++){
k += g[n][q];
System.out.print(g[n][q] + " " + (q + 1 == h ? "\t|\tAverage\t" + (double) k / h + "\n" : ""));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment