Skip to content

Commit 0cebb25

Browse files
committed
✅ add exercicces2
1 parent d1502d0 commit 0cebb25

File tree

76 files changed

+72
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+72
-0
lines changed

exercices2/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exercices2/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "exercices2"
3+
version = "0.1.0"
4+
edition = "2024"
5+
[dependencies]

exercices2/src/main.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use std::io;
2+
3+
fn main() {
4+
println!("Entrer un nombre svp");
5+
6+
let mut nombre = String::new();
7+
let afficher = io::stdin().read_line(&mut nombre).expect("Echec impossible de lire le texte");
8+
9+
println!("taille de {} afficher {} ", afficher , nombre); // nombre est un type String
10+
11+
choisir(&nombre.trim()); //trim() pour enlever le \n ou toutes autres espaces que l'on ne souhaite pas dans nôtre String
12+
}
13+
14+
fn choisir(nombre: &str) {
15+
let result = match nombre {
16+
"1" => String::from("Vous avez selectionné le nombre 1"),
17+
"2" => String::from("Vous avez selectionné le nombre 2"),
18+
"3" => String::from("Vous avez selectionné le nombre 3"),
19+
"19" => String::from("Vous avez selectionné le nombre 19"),
20+
_ => String::from("Vous n'avez pas selectionné un nombre valide"),
21+
};
22+
affichage_du_texte(&result);
23+
}
24+
25+
26+
fn affichage_du_texte(texte: &str) {
27+
28+
println!("Voici vôtre texte : {}", texte);
29+
30+
// Fin de la fonction
31+
}

exercices2/target/.rustc_info.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"rustc_fingerprint":12847960597089090827,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\joshu\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.90.0 (1159e78c4 2025-09-14)\nbinary: rustc\ncommit-hash: 1159e78c4747b02ef996e55082b704c09b970588\ncommit-date: 2025-09-14\nhost: x86_64-pc-windows-msvc\nrelease: 1.90.0\nLLVM version: 20.1.8\n","stderr":""}},"successes":{}}

exercices2/target/CACHEDIR.TAG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Signature: 8a477f597d28d172789f06886806bc55
2+
# This file is a cache directory tag created by cargo.
3+
# For information about cache directory tags see https://bford.info/cachedir/

exercices2/target/debug/.cargo-lock

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
95bbf6b2d884610c
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"rustc":7868289081541623310,"features":"[]","declared_features":"[]","target":18161866901111582998,"profile":17672942494452627365,"path":4942398508502643691,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\exercices2-12becb3650e75c5a\\dep-bin-exercices2","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0}
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file has an mtime of when this was started.

0 commit comments

Comments
 (0)