tp
This commit is contained in:
parent
1c238c2760
commit
dc0bdf3438
BIN
Dev1.1/Dev1910/magique
Executable file
BIN
Dev1.1/Dev1910/magique
Executable file
Binary file not shown.
34
Dev1.1/Dev1910/magique.c
Normal file
34
Dev1.1/Dev1910/magique.c
Normal file
@ -0,0 +1,34 @@
|
||||
#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;
|
||||
}
|
BIN
Dev1.1/Dev2510/Lecture
Executable file
BIN
Dev1.1/Dev2510/Lecture
Executable file
Binary file not shown.
28
Dev1.1/Dev2510/Lecture.c
Normal file
28
Dev1.1/Dev2510/Lecture.c
Normal file
@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void) {
|
||||
char Mdp[25], MdpV[9] = "AZERTYUIO";
|
||||
char a;
|
||||
int i,j;
|
||||
int v = 9;
|
||||
printf("Entrez votre mot de passe :");
|
||||
for(i=0;i<10;i++){
|
||||
Mdp[i] = getchar();
|
||||
printf ("%c",Mdp[i]);
|
||||
}
|
||||
for (j=0;j<10;j++){
|
||||
if(strcmp(Mdp[j],MdpV[j])==1)
|
||||
{
|
||||
v= v-1;
|
||||
printf("Mauvais Mot De Passe");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (v=9) {
|
||||
printf("Bon mot de passe");
|
||||
}
|
||||
printf("\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
0
SCR1.2/TP06/GLOB/11glob22blog3
Normal file
0
SCR1.2/TP06/GLOB/11glob22blog3
Normal file
0
SCR1.2/TP06/GLOB/1glob
Normal file
0
SCR1.2/TP06/GLOB/1glob
Normal file
0
SCR1.2/TP06/GLOB/1glob22
Normal file
0
SCR1.2/TP06/GLOB/1glob22
Normal file
0
SCR1.2/TP06/GLOB/1glob22gloB333
Normal file
0
SCR1.2/TP06/GLOB/1glob22gloB333
Normal file
0
SCR1.2/TP06/GLOB/gLob/44patterN
Normal file
0
SCR1.2/TP06/GLOB/gLob/44patterN
Normal file
0
SCR1.2/TP06/GLOB/gLob/Pattern4
Normal file
0
SCR1.2/TP06/GLOB/gLob/Pattern4
Normal file
0
SCR1.2/TP06/GLOB/gLob/pAtterN
Normal file
0
SCR1.2/TP06/GLOB/gLob/pAtterN
Normal file
0
SCR1.2/TP06/GLOB/gLob/paTTerN/theglobpattern
Normal file
0
SCR1.2/TP06/GLOB/gLob/paTTerN/theglobpattern
Normal file
0
SCR1.2/TP06/GLOB/gLob/patterN
Normal file
0
SCR1.2/TP06/GLOB/gLob/patterN
Normal file
0
SCR1.2/TP06/GLOB/gloB1bloG
Normal file
0
SCR1.2/TP06/GLOB/gloB1bloG
Normal file
BIN
SCR1.2/TP06/globpattern.tar
Normal file
BIN
SCR1.2/TP06/globpattern.tar
Normal file
Binary file not shown.
3507
SCR1.2/TP06/shop
Normal file
3507
SCR1.2/TP06/shop
Normal file
File diff suppressed because it is too large
Load Diff
9
SCR1.2/TP06/tp06_reponses.txt
Normal file
9
SCR1.2/TP06/tp06_reponses.txt
Normal file
@ -0,0 +1,9 @@
|
||||
Partie I
|
||||
1) ls -d GLOB/gLob/*[[:upper:]];
|
||||
2) ls -d GLOB/*[[:upper:]]*
|
||||
3) chiffre = [[:digit:]]
|
||||
ls -d GLOB/?[[:digit:]]* GLOB/gLob/?[[:digit:]]*
|
||||
4 ) ls -d GLOB/*[0-9][0-9]*
|
||||
Partie II
|
||||
1) shopt -s nullglob (set on nullglob)
|
||||
shopt -u nullglob (set off nullglob)
|
32
SCR1.2/TP07/TP07_reponses.txt
Normal file
32
SCR1.2/TP07/TP07_reponses.txt
Normal file
@ -0,0 +1,32 @@
|
||||
Partie I
|
||||
1) Affiche : 12, la longueur de stock_market
|
||||
2) Il va afficher la sous chaine à la position 1 de taille 5 (du caratère 1 à 5) Affiche : Stock
|
||||
3) il va afficher les caractères de la position 7 à 19 de stock_market
|
||||
4) index renvoie l'indice d'une chaine de caractère expr index stock_market "_" renvoie 6 cart _ à la 6ème place
|
||||
5)il renvoie 4, place de c car c apparait avant _
|
||||
|
||||
|
||||
011101101101010 : pour récupérer le premier bit : expr substr $x 1 8
|
||||
exemple : l = $(cat toto);for i in $l;do mkdir$i ;done
|
||||
|
||||
exemple.sh
|
||||
#!/bin/bash à mettre au début du fichier
|
||||
l = $(cat toto)
|
||||
for i in $l
|
||||
do mkdir $i
|
||||
done
|
||||
|
||||
2#101 = 5 car 2# converti de la base 2 à 10
|
||||
|
||||
1- addr"10110010111000101000011101110010"; expr length $addr
|
||||
2- x = $(expr substr $addr 1 8)
|
||||
y = $(expr substr $addr 9 8)
|
||||
z = $(expr substr $addr 17 8)
|
||||
t = $(expr substr $addr 25 8)
|
||||
3 vx = $((2#$x))
|
||||
vy = $((2#$x))
|
||||
vz = $((2#$x))
|
||||
vt = $((2#$t))
|
||||
4) addr_dot="$vx.$vy.$vz.$vt"
|
||||
echo $addr_dot
|
||||
|
Loading…
Reference in New Issue
Block a user