First commit

This commit is contained in:
2026-04-08 20:11:20 +02:00
parent 10fe469c10
commit 79f15536a1
861 changed files with 135610 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
{
"files.associations": {
"*.py": "python",
"iostream": "cpp"
}
}

View File

@@ -0,0 +1,28 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\Program Files Perso\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"*.cpp",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}

View File

@@ -0,0 +1,37 @@
{
R : Calcule le plus grand diviseur commun entre 2 entier a et b
E : a et b, 2 entiers positifs
S : un entier correspondant au plus grand diviseur commun de a et b
}
pgcd: une fonction (a: un entier, b un entier) -> un entier
Lexique : {Local à pgcd}
r : un entier
Algorithme : {Local à pgcd}
Début
Tant Que b != 0
r <- a reste b
a <- b
b <- r
Fin Tant Que
Retourner(a)
Fin
Lexique : {Principal}
{R : ...; E : ...; S : ...}
pgcd: une fonction (a: un entier, b un entier) -> un entier
a : un entier
b : un entier
plusGrandDiviseur : un entier
Algorithme : {Principal}
Début
Ecrire("Entrez a un entier positif")
Lire(a)
Ecrire("Entrez b un entier positif")
Lire(b)
plusGrandDiviseur <- pgcd(a, b)
Ecrire("Le plus grand diviseur commun de ", a, " et ", b, " est ", plusGrandDiviseur)
Fin

View File

@@ -0,0 +1,12 @@
#include "fonction.h"
unsigned int pgcd(unsigned int a, unsigned int b) {
unsigned int r;
while (b != 0) {
r = a % b;
a = b;
b = r;
}
return a;
}

View File

@@ -0,0 +1 @@
unsigned int pgcd(unsigned int a, unsigned int b);

Binary file not shown.

View File

@@ -0,0 +1,23 @@
#include <iostream>
#include "fonction.h"
using namespace std;
int main() {
unsigned int a;
unsigned int b;
unsigned int plusGrandDiviseur;
cout << "Entrez a un entier positif" << endl;
cin >> a;
cout << "Entrez b un entier positif" << endl;
cin >> b;
plusGrandDiviseur = pgcd(a, b);
cout << "Le plus grand diviseur commun de " << a << " et " << b << " est " << plusGrandDiviseur << endl;
return 0;
}

Binary file not shown.