Ajout des travaux effectuer
This commit is contained in:
parent
05fac8d3ae
commit
c4e97e13da
61
23BDD/BDD-23-4.sql
Normal file
61
23BDD/BDD-23-4.sql
Normal file
@ -0,0 +1,61 @@
|
||||
//TP4
|
||||
//1
|
||||
SELECT * FROM CommandeBuveur;
|
||||
|
||||
//Ca marche
|
||||
|
||||
DELETE FROM CommandeBuveur
|
||||
WHERE numCom = 8;
|
||||
|
||||
SELECT * FROM CommandeBuveur;
|
||||
|
||||
//Ca marche
|
||||
|
||||
UPDATE CommandeBuveur
|
||||
SET dateCom = '11-DEC-11'
|
||||
WHERE numCom = 3;
|
||||
|
||||
SELECT * FROM CommandeBuveur;
|
||||
|
||||
//Ca marche
|
||||
|
||||
UPDATE CommandeBuveur
|
||||
SET nomBuveur = 'MAURICE'
|
||||
WHERE numCom = 3;
|
||||
|
||||
SELECT * FROM CommandeBuveur;
|
||||
|
||||
//On peut pas parce que cela concerne un autre tableau
|
||||
|
||||
INSERT INTO CommandeBuveur
|
||||
VALUES (15, '11-SEP-11', 'FRANCOIS');
|
||||
|
||||
SELECT * FROM CommandeBuveur;
|
||||
//On peut pas parce que cela concerne un autre tableau
|
||||
|
||||
//2
|
||||
|
||||
SELECT * FROM VIN2;
|
||||
|
||||
UPDATE VIN2
|
||||
SET cru = 'BOURGEUIL'
|
||||
WHERE numvin = 85;
|
||||
|
||||
SELECT * FROM VIN2;
|
||||
//Ca marche
|
||||
DELETE FROM VIN2
|
||||
WHERE numvin = 190;
|
||||
|
||||
SELECT * FROM VIN2;
|
||||
SELECT * FROM Vin;
|
||||
//Ca marche
|
||||
|
||||
INSERT INTO VIN2
|
||||
VALUES (10, 'CHINON', 'LOIRE');
|
||||
|
||||
SELECT * FROM VIN2;
|
||||
|
||||
//Ca marche pas
|
||||
|
||||
//3
|
||||
|
36
23BDD/BDD-23.sql
Normal file
36
23BDD/BDD-23.sql
Normal file
@ -0,0 +1,36 @@
|
||||
CREATE TABLE Buveur (
|
||||
NumBuveur NUMBER PRIMARY KEY,
|
||||
Nom VARCHAR2(25) NOT NULL,
|
||||
Prenom VARCHAR2(25),
|
||||
Ville VARCHAR2(30) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE Viticulteur (
|
||||
NumVitic NUMBER PRIMARY KEY,
|
||||
Nom VARCHAR2(25) NOT NULL,
|
||||
Prenom VARCHAR2(25),
|
||||
Ville VARCHAR2(30) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE Vin (
|
||||
NumVin NUMBER PRIMARY KEY,
|
||||
cru VARCHAR2(15) NOT NULL,
|
||||
Millesime INT NOT NULL,
|
||||
Region VARCHAR2(15) NOT NULL,
|
||||
NumVitic NUMBER REFERENCES Viticulteur
|
||||
);
|
||||
|
||||
CREATE TABLE Commande (
|
||||
NumCom NUMBER PRIMARY KEY,
|
||||
NumBuveur NUMBER REFERENCES Buveur,
|
||||
NumVin NUMBER REFERENCES Vin,
|
||||
Qtte INT NOT NULL,
|
||||
DateCom DATE NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE Livraison (
|
||||
NumCom NUMBER REFERENCES Commande NOT NULL,
|
||||
Qte NUMBER NOT NULL,
|
||||
DateLiv DATE,
|
||||
PRIMARY KEY(NumCom, DateLiv)
|
||||
);
|
63
23BDD/BDD-23~1.sql
Normal file
63
23BDD/BDD-23~1.sql
Normal file
@ -0,0 +1,63 @@
|
||||
//1
|
||||
SELECT *
|
||||
FROM Buveur;
|
||||
|
||||
//2
|
||||
SELECT NumBuveur, NomB, VilleB
|
||||
FROM Buveur;
|
||||
|
||||
//3
|
||||
SELECT NumBuveur, NomB
|
||||
FROM Buveur
|
||||
WHERE VilleB = 'PARIS';
|
||||
|
||||
//4
|
||||
SELECT NumBuveur, NomB
|
||||
FROM Buveur
|
||||
WHERE VilleB = 'PARIS' OR VilleB = 'MACON';
|
||||
|
||||
//5
|
||||
SELECT cru
|
||||
FROM Vin
|
||||
WHERE Region = 'LOIRE';
|
||||
//ou
|
||||
SELECT DISTINCT cru
|
||||
FROM Vin
|
||||
WHERE Region = 'LOIRE';
|
||||
|
||||
//6
|
||||
SELECT DISTINCT VilleB
|
||||
FROM Buveur;
|
||||
|
||||
//7
|
||||
SELECT NumCom
|
||||
FROM Commande
|
||||
WHERE Qtte > 10 AND Qtte < 50;
|
||||
//ou
|
||||
SELECT NumCom
|
||||
FROM Commande
|
||||
WHERE Qtte BETWEEN 10 AND 50;
|
||||
|
||||
//8
|
||||
SELECT NumCom
|
||||
FROM Livraison
|
||||
WHERE DateLiv > '1-DEC-1987';
|
||||
|
||||
//9
|
||||
SELECT NumVin, cru
|
||||
FROM Vin
|
||||
WHERE cru LIKE 'B%';
|
||||
|
||||
//10
|
||||
SELECT NumVitic, NomV
|
||||
FROM Viticulteur
|
||||
WHERE NomV LIKE '%LIN%';
|
||||
|
||||
//11
|
||||
SELECT NumBuveur, NomB
|
||||
FROM Buveur
|
||||
WHERE VilleB != 'PARIS' AND VilleB != 'MACON';
|
||||
//ou
|
||||
SELECT NumBuveur, NomB
|
||||
FROM Buveur
|
||||
WHERE VilleB NOT IN('PARIS', 'MACON');
|
54
23BDD/BDD23-5.sql
Normal file
54
23BDD/BDD23-5.sql
Normal file
@ -0,0 +1,54 @@
|
||||
//1.1
|
||||
SELECT *
|
||||
FROM Vin V LEFT OUTER JOIN Commande C ON V.NumVin = C.NumVin;
|
||||
|
||||
//1.2
|
||||
SELECT NumBuveur
|
||||
FROM Buveur
|
||||
WHERE NumBuveur NOT IN (SELECT NumBuveur FROM Commande);
|
||||
|
||||
//1.3
|
||||
(SELECT NumBuveur, Nom
|
||||
FROM Buveur NATURAL JOIN Commande NATURAL JOIN Vin
|
||||
WHERE Region = 'BOURGOGNE')
|
||||
MINUS
|
||||
(SELECT NumBuveur, Nom
|
||||
FROM Buveur NATURAL JOIN Commande NATURAL JOIN Vin
|
||||
WHERE Region != 'BOURGOGNE');
|
||||
|
||||
//1.4
|
||||
(SELECT NumBuveur, Nom
|
||||
FROM Buveur NATURAL JOIN Commande NATURAL JOIN Vin
|
||||
WHERE Region = 'BOURGOGNE')
|
||||
INTERSECT
|
||||
(SELECT NumBuveur, Nom
|
||||
FROM Buveur NATURAL JOIN Commande NATURAL JOIN Vin
|
||||
WHERE Region = 'BORDEAUX');
|
||||
|
||||
//2.5
|
||||
INSERT INTO Vin
|
||||
VALUES (200, 'ARBOIS', 1985, 'JURA', 20);
|
||||
|
||||
SELECT *
|
||||
FROM Vin;
|
||||
|
||||
SELECT *
|
||||
FROM Livraison;
|
||||
|
||||
SELECT *
|
||||
FROM Vin;
|
||||
//2.6
|
||||
UPDATE Commande
|
||||
SET Qtte = 12
|
||||
WHERE numCom = 7;
|
||||
|
||||
//2.7
|
||||
DELETE FROM Livraison
|
||||
WHERE NumCom IN (SELECT NumCom FROM Buveur NATURAL JOIN Commande WHERE Nom = 'DUPOND');
|
||||
|
||||
|
||||
|
||||
//2.8
|
||||
|
||||
INSERT INTO Commande
|
||||
VALUES (10, 1500, 100, 18, CURRENT);
|
16
23BDD/ORA2-TP6.sql
Normal file
16
23BDD/ORA2-TP6.sql
Normal file
@ -0,0 +1,16 @@
|
||||
//TP6
|
||||
|
||||
//1
|
||||
CREATE USER RABAN_PROP1
|
||||
IDENTIFIED BY iut
|
||||
DEFAULT TABLESPACE datausers4F
|
||||
TEMPORARY TABLESPACE temp;
|
||||
|
||||
CREATE USER RABAN_PROP2
|
||||
IDENTIFIED BY iut
|
||||
DEFAULT TABLESPACE datausers4F
|
||||
TEMPORARY TABLESPACE temp;
|
||||
|
||||
GRANT CONNECT, RESOURCE TO RABAN_PROP1, RABAN_PROP2;
|
||||
|
||||
|
66
23BDD/PROP1-TP6.sql
Normal file
66
23BDD/PROP1-TP6.sql
Normal file
@ -0,0 +1,66 @@
|
||||
//2
|
||||
//A
|
||||
CREATE TABLE Client_C (
|
||||
login VARCHAR2(20) PRIMARY KEY,
|
||||
nomClient VARCHAR2(30),
|
||||
prenomClient VARCHAR2(30)
|
||||
);
|
||||
|
||||
CREATE TABLE Film (
|
||||
numFilm number PRIMARY KEY,
|
||||
nomFilm VARCHAR2(30)
|
||||
);
|
||||
|
||||
CREATE TABLE Location_L (
|
||||
login VARCHAR2(20) REFERENCES Client_C,
|
||||
numFilm number REFERENCES Film,
|
||||
dateLocation DATE,
|
||||
PRIMARY KEY(login, numFilm)
|
||||
);
|
||||
|
||||
//B
|
||||
INSERT INTO Client_C VALUES('RABAN_PROP1', 'AURIEL', 'Samuel');
|
||||
INSERT INTO Client_C VALUES('RABAN_PROP2', 'BEL', 'Commode');
|
||||
INSERT INTO Client_C VALUES('BANANA', 'O', 'Beng');
|
||||
|
||||
INSERT INTO Film VALUES(01, 'La petite sirene d alarme');
|
||||
INSERT INTO Film VALUES(02, 'Retour vers le présent');
|
||||
INSERT INTO Film VALUES(03, 'starsheep trooper');
|
||||
INSERT INTO Film VALUES(04, 'Splatoon');
|
||||
INSERT INTO Film VALUES(05, 'BESOIN DE VIOLENCE 4');
|
||||
INSERT INTO Film VALUES(06, 'Il étais une fois chez moi');
|
||||
|
||||
INSERT INTO Location_L VALUES('RABAN_PROP1', 01, '02-JAN-2002');
|
||||
INSERT INTO Location_L VALUES('RABAN_PROP2', 02, '05-MAR-2004');
|
||||
INSERT INTO Location_L VALUES('BANANA', 03, '07-DEC-2012');
|
||||
INSERT INTO Location_L VALUES('RABAN_PROP1', 06, '02-JAN-2002');
|
||||
INSERT INTO Location_L VALUES('RABAN_PROP2', 04, '05-MAR-2004');
|
||||
INSERT INTO Location_L VALUES('BANANA', 05, '07-DEC-2012');
|
||||
|
||||
//C
|
||||
CREATE VIEW MES_LOCATIONS (nomClient, numFilm, dateLocation)
|
||||
AS SELECT nomClient, numFilm, dateLocation FROM Location_L NATURAL JOIN Client_C WHERE login = USER;
|
||||
|
||||
commit;
|
||||
|
||||
//3
|
||||
|
||||
//B
|
||||
GRANT SELECT ON Client_C TO RABAN_PROP2;
|
||||
|
||||
//4
|
||||
|
||||
//A
|
||||
|
||||
GRANT SELECT ON MES_LOCATIONS TO RABAN_PROP2;
|
||||
GRANT SELECT,INSERT,DELETE ON Location_L TO RABAN_PROP2;
|
||||
GRANT INSERT,UPDATE(nomClient, prenomClient) ON Client_C TO RABAN_PROP2;
|
||||
GRANT INSERT ON Film TO RABAN_PROP2;
|
||||
|
||||
//D
|
||||
|
||||
SELECT * FROM Client_C;
|
||||
SELECT * FROM Film;
|
||||
SELECT * FROM location_L;
|
||||
|
||||
COMMIT;
|
28
23BDD/PROP2-TP6.sql
Normal file
28
23BDD/PROP2-TP6.sql
Normal file
@ -0,0 +1,28 @@
|
||||
//3
|
||||
|
||||
//A
|
||||
|
||||
SELECT * FROM RABAN_PROP1.Client_C;
|
||||
|
||||
SELECT * FROM RABAN_PROP1.mes_locations;
|
||||
|
||||
//C
|
||||
|
||||
INSERT INTO RABAN_PROP1.Client_C VALUES ('YESSIR','123','Trois petitCHATCHATCHAT');
|
||||
|
||||
INSERT INTO RABAN_PROP1.Film VALUES (07,'Le monde incroyable de Marvin');
|
||||
|
||||
INSERT INTO RABAN_PROP1.Location_L VALUES ('RABAN_PROP2',07,'12-JUN-2010');
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
//5
|
||||
|
||||
//A
|
||||
|
||||
|
||||
|
||||
//B
|
||||
|
||||
|
44
23BDD/SAE/BDD-23.sql
Normal file
44
23BDD/SAE/BDD-23.sql
Normal file
@ -0,0 +1,44 @@
|
||||
CREATE TABLE Gare (
|
||||
IdGare INT Primary Key,
|
||||
Ville varchar2(100),
|
||||
NomGare varchar2(50)
|
||||
);
|
||||
CREATE TABLE PersonneP (
|
||||
idPersonne INT Primary Key,
|
||||
NomPers varchar2(50),
|
||||
PrenomPers varchar2(50),
|
||||
AdressePers varchar2(100),
|
||||
TelPers varchar2(10)
|
||||
);
|
||||
CREATE TABLE Conducteur (
|
||||
idPersonne INT Primary Key REFERENCES PersonneP,
|
||||
telPro varchar2(10),
|
||||
centreRattachement varchar2(50),
|
||||
datePermis Date
|
||||
);
|
||||
CREATE TABLE Train (
|
||||
idTrain INT Primary Key,
|
||||
typeTrain varchar2(50),
|
||||
duplex INT,
|
||||
idGareDep INT REFERENCES Gare,
|
||||
idGareArrivee INT REFERENCES Gare,
|
||||
idPersonne INT REFERENCES Conducteur
|
||||
);
|
||||
CREATE TABLE Trajet (
|
||||
IdTrain INT REFERENCES Train,
|
||||
dateDepart DATE,
|
||||
heureDepart INT,
|
||||
heureArrivee INT,
|
||||
tarifBase INT,
|
||||
Primary Key (IdTrain,dateDepart,heureDepart)
|
||||
);
|
||||
CREATE TABLE VoyageV(
|
||||
IdVoyage INT PRIMARY KEY,
|
||||
dateCreation DATE,
|
||||
codeTarif INT,
|
||||
idTrain INT,
|
||||
DateDepart DATE,
|
||||
heureDepart INT,
|
||||
Foreign Key (idTrain,dateDepart, heureDepart) REFERENCES Trajet
|
||||
);
|
||||
|
51
23BDD/SAE/BDD23(part3).sql
Normal file
51
23BDD/SAE/BDD23(part3).sql
Normal file
@ -0,0 +1,51 @@
|
||||
DROP TABLE Voyage;
|
||||
DROP TABLE Trajet;
|
||||
DROP TABLE Train;
|
||||
DROP TABLE Conducteur;
|
||||
DROP TABLE Personne;
|
||||
DROP TABLE Gare;
|
||||
|
||||
CREATE TABLE Gare (
|
||||
IdGare INT Primary Key,
|
||||
Ville varchar2(100),
|
||||
NomGare varchar2(50)
|
||||
);
|
||||
CREATE TABLE Personne (
|
||||
idPersonne INT Primary Key,
|
||||
NomPers varchar2(50),
|
||||
PrenomPers varchar2(50),
|
||||
AdressePers varchar2(100),
|
||||
TelPers varchar2(10)
|
||||
);
|
||||
CREATE TABLE Conducteur (
|
||||
idPersonne INT Primary Key REFERENCES Personne,
|
||||
telPro varchar2(10),
|
||||
centreRattachement varchar2(50),
|
||||
datePermis Date
|
||||
);
|
||||
CREATE TABLE Train (
|
||||
idTrain INT Primary Key,
|
||||
typeTrain varchar2(50),
|
||||
duplex Boolean,
|
||||
idGareDep INT REFERENCES Gare,
|
||||
idGareArrivee INT REFERENCES Gare,
|
||||
idPersonne INT REFERENCES Conducteur
|
||||
);
|
||||
CREATE TABLE Trajet (
|
||||
IdTrain INT REFERENCES Train,
|
||||
dateDepart DATE,
|
||||
heureDepart INT,
|
||||
heureArrivee INT,
|
||||
tarifBase INT,
|
||||
Primary Key (IdTrain,dateDepart,heureDepart)
|
||||
);
|
||||
CREATE TABLE Voyage(
|
||||
IdVoyage INT PRIMARY KEY,
|
||||
dateCreation DATE,
|
||||
codeTarif INT,
|
||||
idTrain INT,
|
||||
DateDepart DATE,
|
||||
heureDepart INT,
|
||||
Foreign Key (idTrain,dateDepart, heureDepart) REFERENCES Trajet
|
||||
);
|
||||
|
7345
23BDD/SAE/SAE_Part_1.mdj
Normal file
7345
23BDD/SAE/SAE_Part_1.mdj
Normal file
File diff suppressed because it is too large
Load Diff
0
23BDD/SAE/Test.sql
Normal file
0
23BDD/SAE/Test.sql
Normal file
41
23BDD/TP1-S2.sql
Normal file
41
23BDD/TP1-S2.sql
Normal file
@ -0,0 +1,41 @@
|
||||
//1
|
||||
SELECT region, COUNT(*)
|
||||
FROM Vin
|
||||
GROUP BY region;
|
||||
//2
|
||||
SELECT nom, numvitic, COUNT(DISTINCT cru)
|
||||
FROM Viticulteur NATURAL JOIN Vin
|
||||
GROUP BY nom, numvitic;
|
||||
//3
|
||||
SELECT nom, numbuveur, AVG(ALL qtte)
|
||||
FROM Buveur NATURAL JOIN Commande
|
||||
WHERE ville = 'PARIS'
|
||||
GROUP BY nom, numbuveur;
|
||||
//4
|
||||
SELECT numBuveur, COUNT (*)
|
||||
FROM Commande
|
||||
GROUP BY numBuveur;
|
||||
//5
|
||||
SELECT NumBuveur, SUM(qtte)
|
||||
FROM Commande
|
||||
GROUP BY NumBuveur
|
||||
HAVING AVG(qtte)>=12;
|
||||
//6
|
||||
SELECT nom, numvitic
|
||||
FROM viticulteur NATURAL JOIN vin
|
||||
GROUP BY nom, numvitic
|
||||
HAVING COUNT(DISTINCT cru) >= 2;
|
||||
//7
|
||||
SELECT numvin, cru, COUNT()
|
||||
FROM
|
||||
WHERE ;
|
||||
//8
|
||||
SELECT
|
||||
FROM
|
||||
GROUP BY
|
||||
HAVING;
|
||||
/*SELECT
|
||||
FROM
|
||||
WHERE
|
||||
GROUP BY
|
||||
HAVING*/
|
141
23BDD/TP2ET3.sql
Normal file
141
23BDD/TP2ET3.sql
Normal file
@ -0,0 +1,141 @@
|
||||
//TP2
|
||||
|
||||
//1
|
||||
CREATE VIEW VinDesViticulteurs(idVin, Cru, idViticulteur, nomViticulteur)
|
||||
AS SELECT numVin, Cru, numVitic, nom
|
||||
FROM Vin NATURAL JOIN Viticulteur
|
||||
WHERE region = 'BOURGOGNE';
|
||||
|
||||
//2
|
||||
CREATE VIEW BuvCom(numero, nom, nbrCommandes)
|
||||
AS (SELECT numBuveur, nom, COUNT(*)
|
||||
FROM Buveur NATURAL JOIN Commande
|
||||
GROUP BY numBuveur, nom)
|
||||
UNION
|
||||
(SELECT numBuveur, nom, NULL
|
||||
FROM Buveur
|
||||
WHERE numBuveur NOT IN(SELECT numBuveur FROM Commande));
|
||||
|
||||
INSERT INTO BuvCom VALUES(1750, 'JAMET', null);
|
||||
|
||||
UPDATE BuvCom
|
||||
SET
|
||||
WHERE ;
|
||||
|
||||
DELETE BuvCom
|
||||
;
|
||||
|
||||
DROP VIEW BuvCom;
|
||||
|
||||
//3
|
||||
SELECT numVitic, nom
|
||||
FROM Viticulteur NATURAL JOIN Vin NATURAL JOIN Commande;
|
||||
|
||||
//4
|
||||
SELECT numVitic, nom
|
||||
FROM Vin V NATURAL JOIN Viticulteur
|
||||
WHERE NOT EXISTS(
|
||||
SELECT *
|
||||
FROM Commande
|
||||
WHERE Commande.numVin = V.numVin);
|
||||
|
||||
//5
|
||||
SELECT
|
||||
FROM
|
||||
WHERE ;
|
||||
|
||||
//6
|
||||
SELECT
|
||||
FROM
|
||||
WHERE ;
|
||||
|
||||
//7
|
||||
SELECT
|
||||
FROM
|
||||
WHERE ;
|
||||
|
||||
|
||||
//TP3
|
||||
//Q1
|
||||
//1
|
||||
ALTER TABLE Buveur ADD CODE_TARIF varchar2(50) DEFAULT 'BASE';
|
||||
|
||||
//2
|
||||
CREATE TABLE Cave_Cooperative(
|
||||
NumCav NUMBER PRIMARY KEY,
|
||||
Ville_Cav varchar2(30) NOT NULL,
|
||||
NumResp NUMBER NOT NULL REFERENCES Viticulteur
|
||||
);
|
||||
|
||||
//3
|
||||
ALTER TABLE Viticulteur ADD NumCav NUMBER REFERENCES Cave_Cooperative NOT NULL;
|
||||
|
||||
//4
|
||||
INSERT INTO Cave_Cooperative VALUES(10, 'MACON', 01);
|
||||
|
||||
//5
|
||||
INSERT INTO Viticulteur VALUES(40, 'WEISS', 'JACQUES', 'COLMAR', null);
|
||||
INSERT INTO Cave_Cooperative VALUES(12, 'STRASBOURG', 40);
|
||||
COMMIT;
|
||||
|
||||
//Q2
|
||||
|
||||
//1
|
||||
CREATE TABLE Buveur2(
|
||||
NumBuveur NUMBER PRIMARY KEY,
|
||||
Nom VARCHAR2(25) NOT NULL,
|
||||
Prenom VARCHAR2(25),
|
||||
Ville VARCHAR2(30) NOT NULL
|
||||
);
|
||||
ALTER TABLE Buveur2 ADD CODE_TARIF varchar2(50) DEFAULT 'BASE';
|
||||
|
||||
insert into Buveur2 (select * from raban.buveur);
|
||||
//2
|
||||
ALTER TABLE Buveur2 DROP COLUMN Ville;
|
||||
|
||||
//3
|
||||
CREATE TABLE Commande2(
|
||||
NumCom NUMBER PRIMARY KEY,
|
||||
NumBuveur NUMBER REFERENCES Buveur2,
|
||||
NumVin NUMBER REFERENCES Vin,
|
||||
Qtte INT NOT NULL,
|
||||
DateCom DATE NOT NULL
|
||||
);
|
||||
|
||||
//4
|
||||
ALTER TABLE Buveur2 DROP COLUMN numBuveur;
|
||||
|
||||
//Q3
|
||||
|
||||
//1
|
||||
ALTER TABLE Buveur2 MODIFY Nom varchar2(15);
|
||||
|
||||
//2
|
||||
ALTER TABLE Buveur2 MODIFY Prenom varchar2(5);
|
||||
|
||||
//3
|
||||
ALTER TABLE Buveur2 RENAME COLUMN Nom TO NomBuveur;
|
||||
|
||||
//4
|
||||
ALTER TABLE Buveur2 RENAME COLUMN NumBuveur TO idBuv;
|
||||
|
||||
//5
|
||||
/*Suivant si les données,on peut modifier le type, et on peut modifier le nom*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
27
23BDD/TP3.txt
Normal file
27
23BDD/TP3.txt
Normal file
@ -0,0 +1,27 @@
|
||||
1/
|
||||
|
||||
SELECT NumBuveur, NomB, villeB
|
||||
FROM
|
||||
|
||||
2/
|
||||
|
||||
3/
|
||||
|
||||
4/
|
||||
|
||||
5/
|
||||
|
||||
6/
|
||||
|
||||
7/
|
||||
|
||||
8/
|
||||
|
||||
9/
|
||||
|
||||
10/
|
||||
|
||||
11/
|
||||
|
||||
12/
|
||||
|
135
23BDD/TP4.sql
Normal file
135
23BDD/TP4.sql
Normal file
@ -0,0 +1,135 @@
|
||||
//1
|
||||
DROP TABLE Personnel;
|
||||
DROP TABLE Peut_Atterrir;
|
||||
DROP TABLE Avion;
|
||||
DROP TABLE Type_Avion;
|
||||
DROP TABLE Vol;
|
||||
DROP TABLE Aeroport;
|
||||
|
||||
CREATE TABLE Aeroport (
|
||||
codeAeroport varchar2(15) NOT NULL Primary Key,
|
||||
nom varchar2(40) NOT NULL UNIQUE,
|
||||
ville varchar2(40) NOT NULL UNIQUE,
|
||||
pays varchar2(40) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
CREATE TABLE Vol (
|
||||
numVol INT Primary Key NOT NULL,
|
||||
Compagnie varchar2(40) NOT NULL,
|
||||
periodeVol varchar2(30) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE Type_Avion (
|
||||
nomType varchar2(40) NOT NULL Primary Key,
|
||||
maxSieges INT NOT NULL,
|
||||
nomConstructeur varchar2(40) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE Avion (
|
||||
idAvion INT NOT NULL Primary Key,
|
||||
totalSieges INT NOT NULL,
|
||||
nomTypeAvion varchar2(40) REFERENCES Type_Avion
|
||||
);
|
||||
|
||||
CREATE TABLE Peut_Atterrir (
|
||||
nomTypeAvion varchar2(40) REFERENCES Type_Avion,
|
||||
codeAeroport varchar2(15) REFERENCES Aeroport
|
||||
);
|
||||
|
||||
CREATE TABLE Personnel(
|
||||
idPersonne INT NOT NULL Primary Key,
|
||||
nom varchar2(40) NOT NULL,
|
||||
prenom varchar2(40) NOT NULL,
|
||||
fonction varchar2(40) NOT NULL
|
||||
);
|
||||
|
||||
//2
|
||||
|
||||
INSERT INTO Aeroport VALUES('C15RF', 'Charles De Gaulle', 'Roissy-en-France', 'Paris');
|
||||
INSERT INTO Aeroport VALUES('MM4', 'Charles De Gaulle', 'Roissy-en-France', 'Paris');
|
||||
INSERT INTO Aeroport VALUES('JM3630LP', NULL, NULL, NULL);
|
||||
|
||||
INSERT INTO Type_Avion VALUES('RAFALE', 2, 'Dassault Aviation');
|
||||
|
||||
INSERT INTO Avion VALUES(0455632, 2, 'RAFALE');
|
||||
|
||||
INSERT INTO Peut_Atterrir VALUES('RAFALE', 'C15RF');
|
||||
|
||||
DELETE FROM Aeroport
|
||||
WHERE codeAeroport = 'C15RF';
|
||||
|
||||
//3
|
||||
DROP TABLE Hotesse_Equipage;
|
||||
DROP TABLE Equipage;
|
||||
DROP TABLE Instance_Escale;
|
||||
DROP TABLE Escale;
|
||||
|
||||
CREATE TABLE Escale(
|
||||
numVol INT REFERENCES Vol,
|
||||
numEscale INT NOT NULL CONSTRAINT NumLim CHECK(numEscale BETWEEN 0 and 20),
|
||||
aeroportDepart varchar2(15) REFERENCES Aeroport,
|
||||
aeroportArrivee varchar2(15) REFERENCES Aeroport,
|
||||
CONSTRAINT Diff CHECK(aeroportDepart != aeroportArrivee),
|
||||
heureDepartPrevue INT NOT NULL CONSTRAINT CoheureDepartPrevue CHECK(heureDepartPrevue BETWEEN 0 and 23),
|
||||
minuteDepartPrevue INT NOT NULL CONSTRAINT CominuteDepartPrevue CHECK(minuteDepartPrevue BETWEEN 0 and 59),
|
||||
heureArriveePrevue INT NOT NULL CONSTRAINT CoheureArriveePrevue CHECK(heureArriveePrevue BETWEEN 0 and 23),
|
||||
minuteArriveePrevue INT NOT NULL CONSTRAINT CominuteArriveePrevue CHECK(minuteArriveePrevue BETWEEN 0 and 59),
|
||||
Primary Key(numVol, numEscale)
|
||||
);
|
||||
|
||||
CREATE TABLE Instance_Escale (
|
||||
numVol INT,
|
||||
numEscale INT,
|
||||
dateEscale DATE Primary Key,
|
||||
nbrSieges INT NOT NULL,
|
||||
idAvion INT NOT NULL,
|
||||
dateDepartEffectuee DATE NOT NULL,
|
||||
dateArriveeEffectuee DATE NOT NULL,
|
||||
CONSTRAINT DiffDate CHECK(dateDepartEffectuee < dateArriveeEffectuee),
|
||||
idEquipe INT NOT NULL,
|
||||
FOREIGN Key(numVol, numEscale) REFERENCES Escale
|
||||
);
|
||||
|
||||
CREATE TABLE Equipage(
|
||||
numVol INT,
|
||||
numEscale INT,
|
||||
dateEscale DATE,
|
||||
idEquipe INT Primary Key,
|
||||
idPilote INT,
|
||||
idCoPilote INT,
|
||||
idChefCabine INT,
|
||||
FOREIGN Key(numVol, numEscale, dateEscale) REFERENCES Instance_Escale,
|
||||
FOREIGN Key(idPilote, idCoPilote, idChefCabine) REFERENCES Personnel
|
||||
);
|
||||
|
||||
CREATE TABLE Hotesse_Equipage(
|
||||
idEquipe INT REFERENCES Equipage,
|
||||
idPersonne INT REFERENCES Personnel
|
||||
);
|
||||
|
||||
//4
|
||||
|
||||
|
||||
|
||||
//5
|
||||
|
||||
|
||||
|
||||
//6
|
||||
|
||||
//TP5
|
||||
|
||||
//1
|
||||
|
||||
|
||||
CREATE TABLE AUTEUR(
|
||||
NumAuteur number Primary Key,
|
||||
NomAuteur varchar2(20)
|
||||
);
|
||||
|
||||
CREATE TABLE EDITEUR(
|
||||
codeAuteur number Primary Key,
|
||||
RaisonSociale varchar2(20)
|
||||
);
|
||||
|
||||
//2
|
3767
23BDD/TP7.mdj
Normal file
3767
23BDD/TP7.mdj
Normal file
File diff suppressed because it is too large
Load Diff
4259
23BDD/TP8.mdj
Normal file
4259
23BDD/TP8.mdj
Normal file
File diff suppressed because it is too large
Load Diff
12
23BDD/Test.sql
Normal file
12
23BDD/Test.sql
Normal file
@ -0,0 +1,12 @@
|
||||
CREATE VIEW CommandeBuveur (numCom, dateCom, nomBuveur)
|
||||
AS SELECT NumCom, DateCom, Nom
|
||||
FROM Commande NATURAL JOIN Buveur;
|
||||
|
||||
CREATE VIEW VIN2 (numvin, cru, region)
|
||||
AS SELECT NumVin, cru, Region
|
||||
FROM Vin;
|
||||
|
||||
CREATE VIEW Paris (Numbuveur, nom, prenom)
|
||||
AS SELECT NumBuveur,Nom, Prenom
|
||||
FROM Buveur
|
||||
WHERE Ville = 'PARIS';
|
BIN
23DEV1.1/CM1/Exo1
Executable file
BIN
23DEV1.1/CM1/Exo1
Executable file
Binary file not shown.
7
23DEV1.1/CM1/Exo1.c
Normal file
7
23DEV1.1/CM1/Exo1.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("{o,o}\n(__(\\\n-\"-\"-\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/CM1/Exo2
Executable file
BIN
23DEV1.1/CM1/Exo2
Executable file
Binary file not shown.
9
23DEV1.1/CM1/Exo2.c
Normal file
9
23DEV1.1/CM1/Exo2.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%d\n", 57);
|
||||
printf("%o\n", 057);
|
||||
printf("%x\n", 0x57);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/CM1/Exo3
Executable file
BIN
23DEV1.1/CM1/Exo3
Executable file
Binary file not shown.
29
23DEV1.1/CM1/Exo3.c
Normal file
29
23DEV1.1/CM1/Exo3.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
int main(void) {
|
||||
double taille;
|
||||
double pouce;
|
||||
int poucei;
|
||||
double pieds;
|
||||
int piedsi;
|
||||
printf("Entrez votre taille : ");
|
||||
scanf("%lf", &taille);
|
||||
pouce = trunc(taille*100.0)/2.56;
|
||||
poucei = floor(pouce);
|
||||
poucei = poucei % 12;
|
||||
pieds = ceil(round(pouce / 12));
|
||||
piedsi = pieds;
|
||||
if(piedsi > 1){
|
||||
printf("%d pieds, ", piedsi);
|
||||
}else{
|
||||
printf("%d pied, ", piedsi);
|
||||
}
|
||||
if(poucei > 1){
|
||||
printf("%d pouces\n", poucei);
|
||||
}else{
|
||||
printf("%d pouce\n", poucei);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/CM1/Exo4
Executable file
BIN
23DEV1.1/CM1/Exo4
Executable file
Binary file not shown.
24
23DEV1.1/CM1/Exo4.c
Normal file
24
23DEV1.1/CM1/Exo4.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define NUMEROS 27
|
||||
|
||||
int main(void) {
|
||||
char tableau[NUMEROS] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
|
||||
char find;
|
||||
int indice;
|
||||
while(find < 'a' || find > 'z'){
|
||||
printf("Entrez une lettre minuscule : ");
|
||||
find = getchar();
|
||||
}
|
||||
for(indice = 0 ; indice < NUMEROS ; indice++){
|
||||
if(tableau[indice] == find){
|
||||
printf("[%c]", tableau[indice]);
|
||||
}
|
||||
else{
|
||||
printf("%c", tableau[indice]);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/CM1/Exo5
Executable file
BIN
23DEV1.1/CM1/Exo5
Executable file
Binary file not shown.
33
23DEV1.1/CM1/Exo5.c
Normal file
33
23DEV1.1/CM1/Exo5.c
Normal file
@ -0,0 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define NUMEROS 27
|
||||
|
||||
|
||||
int main(void) {
|
||||
int tableau[5];
|
||||
int tabinterdit[5];
|
||||
int indice;
|
||||
int indice2;
|
||||
int doublon = 0;
|
||||
int doublef;
|
||||
for(indice = 0 ; indice < 5 ; indice++){
|
||||
printf("Jet n°%d : ", indice+1);
|
||||
scanf("%d", &tableau[indice]);
|
||||
}
|
||||
for(indice = 0 ; indice < 5 ; indice++){
|
||||
for(indice2 = 0 ; indice2 < 5 ; indice2++){
|
||||
if(tableau[indice] == tableau[indice2]){
|
||||
doublon++;
|
||||
}
|
||||
}
|
||||
if(doublon == 2){
|
||||
doublef++;
|
||||
tabinterdit[indice] = tableau[indice];
|
||||
}
|
||||
doublon = 0;
|
||||
}
|
||||
doublef = doublef/2;
|
||||
printf("Occurrences maximum : %d\n", doublef);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
35
23DEV1.1/CM2/Makefile
Normal file
35
23DEV1.1/CM2/Makefile
Normal file
@ -0,0 +1,35 @@
|
||||
#BUT FINAL
|
||||
|
||||
all : Lightness exo2
|
||||
|
||||
#Variables
|
||||
|
||||
OFILES = main.o \
|
||||
Lightness.o
|
||||
|
||||
CC = gcc
|
||||
|
||||
CFLAGS = -Wall -ansi -pedantic
|
||||
|
||||
#Dépendances
|
||||
|
||||
main.o: carre.c lightness.h
|
||||
|
||||
Lightness.o: lightness.c lightness.h
|
||||
|
||||
#Exec
|
||||
|
||||
Lightness: $(OFILES)
|
||||
$(CC) $(CFLAGS) -o Lightness $(OFILES) && rm -f *.o && echo "Utilisation : ./Lightness"
|
||||
|
||||
exo2 : lightness.c
|
||||
$(CC) $(CFLAGS) -std=gnu99 -o exo3 3Ralenti.c && echo "Utilisation : ./exo3"
|
||||
|
||||
#Nettoyage
|
||||
|
||||
clean:
|
||||
rm -f Lightness && rm -f exo2
|
||||
|
||||
#But factice
|
||||
|
||||
.PHONY : but clean
|
15
23DEV1.1/CM2/Section.c
Normal file
15
23DEV1.1/CM2/Section.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
long dividende, diviseur;
|
||||
ldiv_t q;
|
||||
dividende = strtol(argv[1],NULL,10);
|
||||
diviseur = strtol(argv[2],NULL,10);
|
||||
q = ldiv(dividende, diviseur);
|
||||
printf("Quotient : %lo\n", q.quot);
|
||||
printf("Reste : %lo\n", q.rem);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
17
23DEV1.1/CM2/Sensation.c
Normal file
17
23DEV1.1/CM2/Sensation.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
FILE* fichier = fopen("reitne","r");
|
||||
if(fichier == NULL){
|
||||
fprintf(stderr,"Le fichier est introuvable ou indisponible");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
int nombre;
|
||||
while(!feof(fichier)){
|
||||
fread(&nombre, 1, 1, fichier);
|
||||
printf("%d\n", nombre);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
37
23DEV1.1/CM2/Suite.c
Normal file
37
23DEV1.1/CM2/Suite.c
Normal file
@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int Suite(long val){
|
||||
long tab[100];
|
||||
int valor;
|
||||
int i = 0;
|
||||
for(i = 0; i<100; i++){
|
||||
if(i == 0){
|
||||
valor = val;
|
||||
}
|
||||
else{
|
||||
valor = tab[i-1]/2;
|
||||
}
|
||||
tab[i] = valor;
|
||||
if(i == 0){
|
||||
printf("%d,", tab[i]);
|
||||
}else if(tab[i]%2!=0){
|
||||
printf("%d.", tab[i]);
|
||||
break;
|
||||
}else{
|
||||
printf("%d,", tab[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
if(argc<2){
|
||||
printf("Erreur ! L'usage est : %s <entier> ", argv[0]);
|
||||
}
|
||||
long val;
|
||||
val = strtol(argv[1],NULL,10);
|
||||
Suite(val);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/CM2/a.out
Executable file
BIN
23DEV1.1/CM2/a.out
Executable file
Binary file not shown.
51
23DEV1.1/CM2/carre.c
Normal file
51
23DEV1.1/CM2/carre.c
Normal file
@ -0,0 +1,51 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#define LIGHT 0
|
||||
#define DARK 1
|
||||
#define RED 1
|
||||
#define GREEN 2
|
||||
#define BLUE 4
|
||||
#define LIGHT_RED 217
|
||||
#define DARK_RED 124
|
||||
#define LIGHT_GREEN 157
|
||||
#define DARK_GREEN 34
|
||||
#define LIGHT_BLUE 147
|
||||
#define DARK_BLUE 19
|
||||
|
||||
int light(void);
|
||||
|
||||
int hue(void) {
|
||||
int choice = rand()%3;
|
||||
if (choice == 0) {
|
||||
return RED;
|
||||
} else if (choice == 1) {
|
||||
return GREEN;
|
||||
} else /* if (choice == 2) */ {
|
||||
return BLUE;
|
||||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
int l, c, v;
|
||||
|
||||
srand(time(NULL));
|
||||
l = lightness();
|
||||
c = hue();
|
||||
|
||||
if (c == RED) {
|
||||
v = (l == LIGHT) ? LIGHT_RED : DARK_RED;
|
||||
} else if (c == GREEN) {
|
||||
v = (l == LIGHT) ? LIGHT_GREEN : DARK_GREEN;
|
||||
} else /* if (c == BLUE) */ {
|
||||
v = (l == LIGHT) ? LIGHT_BLUE : DARK_BLUE;
|
||||
}
|
||||
|
||||
printf("┏━━━━┓\n");
|
||||
printf("┃\33[48;5;%dm \33[m┃\n", v);
|
||||
printf("┃\33[48;5;%dm \33[m┃\n", v);
|
||||
printf("┗━━━━┛\n");
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
12
23DEV1.1/CM2/lightness.c
Normal file
12
23DEV1.1/CM2/lightness.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "lightness.h"
|
||||
|
||||
int light(void){
|
||||
if (time(NULL)%2) {
|
||||
return LIGHT;
|
||||
} else {
|
||||
return DARK;
|
||||
}
|
||||
}
|
8
23DEV1.1/CM2/lightness.h
Normal file
8
23DEV1.1/CM2/lightness.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef LIGHTNESS_H
|
||||
#define LIGHTNESS_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
int light(void);
|
||||
|
||||
#endif
|
BIN
23DEV1.1/CM2/reitne
Normal file
BIN
23DEV1.1/CM2/reitne
Normal file
Binary file not shown.
55
23DEV1.1/CM3/Calculs.c
Normal file
55
23DEV1.1/CM3/Calculs.c
Normal file
@ -0,0 +1,55 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct maillon
|
||||
{
|
||||
int valeur;
|
||||
struct maillon* suivant;
|
||||
};
|
||||
|
||||
typedef struct maillon maillon;
|
||||
|
||||
maillon* debut(maillon* m, int v)
|
||||
{
|
||||
maillon* result = malloc(sizeof(maillon));
|
||||
result->valeur = v;
|
||||
result->suivant = m;
|
||||
return result;
|
||||
}
|
||||
|
||||
maillon* creerListe()
|
||||
{
|
||||
maillon* m = NULL;
|
||||
unsigned short int val;
|
||||
srand(time(NULL));
|
||||
for(int i = 0; i<10; i++)
|
||||
{
|
||||
val = ;
|
||||
m = debut(m,val);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
maillon* AdditionListe(maillon* l1, maillon* l2)
|
||||
{
|
||||
maillon* m = NULL;
|
||||
unsigned short int val;
|
||||
srand(time(NULL));
|
||||
for(int i = 0; i<10; i++)
|
||||
{
|
||||
val = ;
|
||||
m = debut(m,val);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
if(argc<1){
|
||||
printf("Il faut plus de valeur!");
|
||||
}else{
|
||||
maillon* premier = creerListe(argv[1]);
|
||||
maillon* deuxième = creerListe(argv[2]);
|
||||
}
|
||||
return 0;
|
||||
}
|
44
23DEV1.1/CM3/Coloration.c
Normal file
44
23DEV1.1/CM3/Coloration.c
Normal file
@ -0,0 +1,44 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
FILE* f;
|
||||
f = fopen("image.pgm","r");
|
||||
int i, j, cas;
|
||||
int largeur, hauteur;
|
||||
couleur c;
|
||||
|
||||
fread(&largeur,3,1,f);
|
||||
fread(&hauteur,3,1,f);
|
||||
|
||||
printf("%d\n",largeur);
|
||||
printf("%d\n",hauteur);
|
||||
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(10, 10, largeur, hauteur);
|
||||
fseek(f,largeur/hauteur,SEEK_CUR);
|
||||
for(i=0;i<largeur;i++){
|
||||
for(j=0;j<hauteur;j++){
|
||||
fread(&cas,sizeof(int),1,f);
|
||||
if(cas == 3){
|
||||
if(i>= 8 || i<= 36){
|
||||
if(j>= 10 || j<= 40){
|
||||
c = CouleurParNom("white");
|
||||
DessinerPixel(i, j);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
fread(&c,sizeof(unsigned long),1,f);
|
||||
ChoisirCouleurDessin(c);
|
||||
DessinerPixel(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
97
23DEV1.1/CM3/Culmination.c
Normal file
97
23DEV1.1/CM3/Culmination.c
Normal file
@ -0,0 +1,97 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int comparatif(int tab[], int n, int argc, int max){
|
||||
int val = max;
|
||||
if(val < tab[n]){
|
||||
val = tab[n];
|
||||
}
|
||||
if(n != argc){
|
||||
comparatif(tab[], n+1, argc, val);
|
||||
}else{
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
int tab[7];
|
||||
int max = 0, n = 1;
|
||||
if(argc<2){
|
||||
printf("Retournez plus de valeur!");
|
||||
return EXIT_FAILURE;
|
||||
}else{
|
||||
if(n != argc){
|
||||
tab[n] = argv[n];
|
||||
n++;
|
||||
if(n != argc){
|
||||
tab[n] = argv[n];
|
||||
n++;
|
||||
if(n != argc){
|
||||
tab[n] = argv[n];
|
||||
n++;
|
||||
if(n != argc){
|
||||
tab[n] = argv[n];
|
||||
n++;
|
||||
if(n != argc){
|
||||
tab[n] = argv[n];
|
||||
n++;
|
||||
if(n != argc){
|
||||
tab[n] = argv[n];
|
||||
n++;
|
||||
if(n != argc){
|
||||
tab[n] = argv[n];
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
n = 0;
|
||||
if(tab[n] != '\0'){
|
||||
if(max<tab[n]){
|
||||
max = tab[n];
|
||||
}
|
||||
n++;
|
||||
if(tab[n] != '\0'){
|
||||
if(max<tab[n]){
|
||||
max = tab[n];
|
||||
}
|
||||
n++;
|
||||
if(tab[n] != '\0'){
|
||||
if(max<tab[n]){
|
||||
max = tab[n];
|
||||
}
|
||||
n++;
|
||||
if(tab[n] != '\0'){
|
||||
if(max<tab[n]){
|
||||
max = tab[n];
|
||||
}
|
||||
n++;
|
||||
if(tab[n] != '\0'){
|
||||
if(max<tab[n]){
|
||||
max = tab[n];
|
||||
}
|
||||
n++;
|
||||
if(tab[n] != '\0'){
|
||||
if(max<tab[n]){
|
||||
max = tab[n];
|
||||
}
|
||||
n++;
|
||||
if(tab[n] != '\0'){
|
||||
if(max<tab[n]){
|
||||
max = tab[n];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%d", max);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/CM3/a.out
Executable file
BIN
23DEV1.1/CM3/a.out
Executable file
Binary file not shown.
49
23DEV1.1/CM3/image.pgm
Normal file
49
23DEV1.1/CM3/image.pgm
Normal file
@ -0,0 +1,49 @@
|
||||
P2 # Format PPM ASCII
|
||||
48 44 # Largeur et Hauteur
|
||||
5 # Intensite maximum
|
||||
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5
|
||||
5 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 5
|
||||
5 4 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 4 5
|
||||
5 4 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5
|
||||
5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5
|
||||
5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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5
|
||||
5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5
|
||||
5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5
|
||||
5 4 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5
|
||||
5 4 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 4 5
|
||||
5 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 5
|
||||
5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
|
BIN
23DEV1.1/SAE/1-SAE/Snake
Executable file
BIN
23DEV1.1/SAE/1-SAE/Snake
Executable file
Binary file not shown.
49
23DEV1.1/SAE/1-SAE/Snake.c
Normal file
49
23DEV1.1/SAE/1-SAE/Snake.c
Normal file
@ -0,0 +1,49 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
#include <time.h>
|
||||
|
||||
void graphique(){
|
||||
int point = 0;
|
||||
int n = 0;
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(1700,950,1700,950);
|
||||
couleur c, r, e;
|
||||
r=CouleurParComposante(0,0,0);
|
||||
ChoisirCouleurDessin(r);
|
||||
RemplirRectangle(0,0,1700,950);
|
||||
c=CouleurParComposante(111,255,94);
|
||||
ChoisirCouleurDessin(c);
|
||||
RemplirRectangle(17,20,1670,850);
|
||||
temps(n);
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
}
|
||||
//1 = pomme ; 2 = mur ; 3 = corps du serpent
|
||||
//deplacement du serpent
|
||||
//detection des obstacles
|
||||
//temps de jeu
|
||||
//score du jeu
|
||||
int score(int ab){
|
||||
ab++;
|
||||
return ab;
|
||||
}
|
||||
|
||||
void temps(int n){
|
||||
couleur f;
|
||||
unsigned long suivant;
|
||||
char buf[100];
|
||||
while(1){
|
||||
if (Microsecondes()>suivant){
|
||||
n++;
|
||||
f=CouleurParNom("white");
|
||||
ChoisirCouleurDessin(f);
|
||||
snprintf(buf,100,"Temps : %05d", n);
|
||||
}
|
||||
}
|
||||
}
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
graphique();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/SAE/1-SAE/Test
Executable file
BIN
23DEV1.1/SAE/1-SAE/Test
Executable file
Binary file not shown.
37
23DEV1.1/SAE/1-SAE/Test.c
Normal file
37
23DEV1.1/SAE/1-SAE/Test.c
Normal file
@ -0,0 +1,37 @@
|
||||
#include <graph.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define DELTA 1000000L;
|
||||
|
||||
void DessinerScene(int n) {
|
||||
couleur c;
|
||||
char buf[100];
|
||||
c = CouleurParNom("white");
|
||||
ChoisirCouleurDessin(c);
|
||||
RemplirRectangle(0,0,100,100);
|
||||
c = CouleurParNom("black");
|
||||
ChoisirCouleurDessin(c);
|
||||
snprintf(buf, 100, "Temps : %05d", n);
|
||||
EcrireTexte(10,20,buf,0);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int n;
|
||||
couleur c;
|
||||
unsigned long suivant;
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(10,10,800,500);
|
||||
n = 0;
|
||||
suivant = Microsecondes()+DELTA;
|
||||
while(1){
|
||||
if(Microsecondes()>suivant) {
|
||||
n++;
|
||||
DessinerScene(n);
|
||||
suivant = Microsecondes()+DELTA;
|
||||
}
|
||||
}
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
40
23DEV1.1/TPS1/TP01/02-entier/BiteOperation.c
Normal file
40
23DEV1.1/TPS1/TP01/02-entier/BiteOperation.c
Normal file
@ -0,0 +1,40 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int n = 1431655765;
|
||||
printf("%d", (n>>31)&1);
|
||||
printf("%d", (n>>30)&1);
|
||||
printf("%d", (n>>29)&1);
|
||||
printf("%d", (n>>28)&1);
|
||||
printf("%d", (n>>27)&1);
|
||||
printf("%d", (n>>26)&1);
|
||||
printf("%d", (n>>25)&1);
|
||||
printf("%d", (n>>24)&1);
|
||||
printf("%d", (n>>23)&1);
|
||||
printf("%d", (n>>22)&1);
|
||||
printf("%d", (n>>21)&1);
|
||||
printf("%d", (n>>20)&1);
|
||||
printf("%d", (n>>19)&1);
|
||||
printf("%d", (n>>18)&1);
|
||||
printf("%d", (n>>17)&1);
|
||||
printf("%d", (n>>16)&1);
|
||||
printf("%d", (n>>15)&1);
|
||||
printf("%d", (n>>14)&1);
|
||||
printf("%d", (n>>13)&1);
|
||||
printf("%d", (n>>12)&1);
|
||||
printf("%d", (n>>11)&1);
|
||||
printf("%d", (n>>10)&1);
|
||||
printf("%d", (n>>9)&1);
|
||||
printf("%d", (n>>8)&1);
|
||||
printf("%d", (n>>7)&1);
|
||||
printf("%d", (n>>6)&1);
|
||||
printf("%d", (n>>5)&1);
|
||||
printf("%d", (n>>4)&1);
|
||||
printf("%d", (n>>3)&1);
|
||||
printf("%d", (n>>2)&1);
|
||||
printf("%d", (n>>1)&1);
|
||||
printf("%d", n&1);
|
||||
printf("\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
23DEV1.1/TPS1/TP01/02-entier/a.out
Executable file
BIN
23DEV1.1/TPS1/TP01/02-entier/a.out
Executable file
Binary file not shown.
16
23DEV1.1/TPS1/TP01/02-entier/arith.c
Normal file
16
23DEV1.1/TPS1/TP01/02-entier/arith.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%d\n", 100/6);
|
||||
printf("%d\n", 100%6);
|
||||
printf("%d\n", 0x1A*015);
|
||||
printf("%d\n", -3/5);
|
||||
printf("%d\n", -31/5);
|
||||
printf("%d\n", -31%5);
|
||||
printf("%d\n", 100*(3/5));
|
||||
printf("%d\n", 100*3/5);
|
||||
printf("%d\n", 2-3-5);
|
||||
printf("%d\n", 2-(3-5));
|
||||
return EXIT_SUCCESS;
|
||||
}
|
12
23DEV1.1/TPS1/TP01/02-entier/bases.c
Normal file
12
23DEV1.1/TPS1/TP01/02-entier/bases.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%d\n", 72);
|
||||
printf("%d\n", 0110);
|
||||
printf("%d\n", 0x48);
|
||||
printf("%d\n", 72);
|
||||
printf("%o\n", 72);
|
||||
printf("%x\n", 72);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user