Académique Documents
Professionnel Documents
Culture Documents
h>
#include <stdlib.h>
{int i,j;
for (i=0;i<3;i++)
for (j=0;j<3;j++)
printf("t[%d][%d]=",i,j);
scanf("%d",&t[i][j]);
printf("\n");
{int i,j;
for (i=0;i<3;i++)
for (j=0;j<3;j++)
printf("t[%d][%d]=%d ",i,j,t[i][j]);
printf("\n");
{int i,j,n,x=0;
printf("entrez la valeur qui rechercher");
scanf("%d",&n);
for(i=0;i<3;i++)
for(j=0;j<3;j++)
if(n==t[i][j])
x=x+1;
int main()
{ int i,n;
int t[3][3];
int choix=1,z;
char str[100],oprator[100],operant[100];
int y;
int opr=-1,op=-1;
printf(" \n Les choix :\n 1 pour entrer les donn�es \n 2 pour afficher la
matrice \n 3 pour calcules la somme des donn�es \n 4 pour transformer a infixee \n
");
while(choix!=0)
{
scanf("%d",&choix);
if((choix<1) || (choix>4))
{
printf("errooor");
}
else
{
switch(choix)
case 1:
lecture (t);
break;
case 2:
affichage (t);
break;
case 3:
occu (t);
break;
case 4:
scanf("%s",str);
for (y=0;str[y]!=NULL;y++)
{
if(str[y]=='+'||str[y]=='-'||str[y]=='*'||str[y]=='^'||str[y]=='/')
{
(opr)++;
oprator[opr]=str[y];
else
(op)++;
operant[op]=str[y];
}
}
printf("operator are:\n");
for (i=0;i<=opr;i++)
printf("%c",oprator[i]);
for (i=0;i<=op;i++)
printf("%c",operant[i]);
break;
}
printf("\n");
return 0;