Skip to content

Instantly share code, notes, and snippets.

@edinak1
Created October 30, 2015 18:43
Show Gist options
  • Save edinak1/e3f0c7ddb2b60d2bffe1 to your computer and use it in GitHub Desktop.
Save edinak1/e3f0c7ddb2b60d2bffe1 to your computer and use it in GitHub Desktop.
package masiv;
public class Population {
public static void main(String[] args) {
String [][]data={{"China","Peking","1354040000"},{"India","NewDelhi","1210569573"},
{"USA","WashingtonD.C.","316305000"},{"Indonesia","Jakarta","237641326"},
{"Brazil","Brasilia","193946886"},{"Pakistan","Islamabad","183748060"}};
System.out.println(getPopulation(data));
}
static long getPopulation(String [][] data)
{
long rezalt=0;
for(int i=0; i<data.length;i++)
rezalt+=Long.valueOf(data[i][2]);
return rezalt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment