Created
October 30, 2015 18:43
-
-
Save edinak1/e3f0c7ddb2b60d2bffe1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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