Ju2010 théorique JavaScript

25 views
Skip to first unread message

bouazza driouch

unread,
Jun 22, 2011, 6:22:05 PM6/22/11
to tsdi-is...@googlegroups.com, tsdi.of...@gmail.com
<HTML> 
<HEAD>
 <TITLE> Juin 2010 - théorique</TITLE>
 </HEAD> 
<BODY> <SCRIPT language="Javascript"> 
<!-- 
tb=new Array(9,9);
i=0; j=0;

function Matrice(T){
var a=true;
var i=0; var j=0;
var somc; var soml;
for(i=0;i<9;i++){
somc=0;soml=0;
for(j=0;j<9;j++){

somc+=T[j,i];
soml+=T[i,j];
}
if (somc!=soml) a=false;
}
return a;
}

for (i=0;i<9;i++){
j=0;
for(j=0;j<9;j++){
tb[i , j]=i+j;
}
for(j=0;j<9;j++){
document.write("  [" + i + "," + j +"]=" + tb[ i , j ] + " -");
}
document.write("<br/>");
}
document.write("<br/>");
i=0;
for (i=0;i<9;i++){
for(j=0;j<9;j++){
document.write("  [" + i + "," + j +"]=" + tb[i, j] + " -");
}
document.write("<br/>");
}
document.write("<br/>");
document.write(Matrice(tb));
// -->
</SCRIPT> 
</BODY>
</HTML>

--
Formateur Ingénieur : OFPPT - DRGC/CFMOTI
Cours-Exercice-Tp-Examen et Correction, Sur:
http://www.ista-ntic.com/ ou http://www.driouchb.0fees.net/

Reply all
Reply to author
Forward
0 new messages