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,17 @@
racine_carree : une fonction (a : un réel, n : un entier) -> un réel
lexique : {Local à racine_carre}
racine: un réel
i : un entier
Algorithme : {Local à racine_carre}
Début
i <- 0
racine <- 1
Tant que i < n
racine <- (racine + a / racine)/2
i <- i + 1
FinTantQue
Retourner(racine)
Fin

View File

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

Binary file not shown.

View File

@@ -0,0 +1,8 @@
float racine_carree(float a, unsigned int n) {
float root = 1;
for (int i=0; i < n; i++) {
root = (root + a / root) / 2;
}
return root;
}

View File

@@ -0,0 +1 @@
float racine_carree(float a, unsigned int n);

View File

@@ -0,0 +1,25 @@
#include <iostream>
#include "fonctions.h"
using namespace std;
int main() {
float root;
float a;
unsigned int n;
do {
cout << "Saisir a" << endl;
cin >> a;
} while (a < 0);
cout << "Saisir la nombre d'itérations" << endl;
cin >> n;
root = racine_carree(a, n);
cout << "Racine de " << a << " = " << root << endl;
return 0;
}