SAE24_2022/resources/scripts/ex1-1.sce

8 lines
338 B
Scilab
Raw Normal View History

2023-05-03 23:19:47 +02:00
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 : %.2f habitants/km²\n", densite);