Ajout Ex1 - Question 1

This commit is contained in:
2023-05-03 23:19:47 +02:00
parent 0c8f15f1cf
commit 5f5a41ff00
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
data = csvRead("resources/data/data.csv");
surface = sum(data(:, 2)*1000);
population = sum(data(:, 3)*1000000);
densite = population / surface;
mprintf("Surface terrestre mondiale : %d km²\n", surface);
mprintf("Nombre d''habitants mondial : %.0f habitants\n", population);
mprintf("Densité moyenne : %.0f habitants/km²\n", densite);