 clear; W=1;
 while W==1    
  n=input('Taille des échantillons = ? ');
  X1=4*(ones(1,n)-rand(1,n).^2).^(1/2);
  X2=2*rand(1,n)-1;
  Y2=2*rand(1,n)-1;
  Z2=4*(X2.^2+Y2.^2<=1); 
  X3=2*rand(1,n)-1; 
  Y3=2*rand(1,n)-1; 
  Z3=2*rand(1,n)-1; 
  T3=3*2*(X3.^2+Y3.^2+Z3.^2<=1); 
  disp('La valeur de Pi est : ') 
  [mean(X1),mean(Z2),mean(T3)]
  W=input('Une autre simulation ? (0=non, 1=oui) ')
 end
