35 lines
834 B
C
35 lines
834 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void) {
|
|
int grille[3][3];
|
|
int i;
|
|
int un,deux,trois;
|
|
printf("entrez la premiere ligne du cube :");
|
|
scanf (" %d %d %d", &grille[0][0],&grille[0][1],&grille[0][2]);
|
|
printf("entrez la seconde ligne du cube :");
|
|
scanf(" %d %d %d",&grille[1][0],&grille[1][1],&grille[1][2]);
|
|
printf("entre la troisième ligne du cube :");
|
|
scanf(" %d %d %d",&grille[2][0],&grille[2][1],&grille[2][2]);
|
|
printf("\n");
|
|
for (i=0;i<3;i++){
|
|
printf(" %d ", grille[0][i]);
|
|
un = un + grille[0][i];
|
|
}
|
|
printf("\n");
|
|
for (i=0;i<3;i++){
|
|
printf (" %d ",grille[1][i]);
|
|
deux = deux + grille[1][i];
|
|
}
|
|
printf("\n");
|
|
for (i=0;i<3;i++){
|
|
printf(" %d ",grille[2][i]);
|
|
trois = trois + grille[2][i];
|
|
}
|
|
printf("\n");
|
|
printf("%d",un);
|
|
printf("%d",deux);
|
|
printf("%d",trois);
|
|
return EXIT_SUCCESS;
|
|
}
|