node and bits

This commit is contained in:
2025-04-07 20:12:04 +02:00
parent ebd3e33a03
commit c4c0c32f0e
6 changed files with 174 additions and 11 deletions

24
3 Normal file
View File

@@ -0,0 +1,24 @@
use std::collections::HashMap;
use std::fs::File;
use std::io::prelude::*;
fn main() -> std::io::Result<()> {
let mut file = File::open("test.txt")?;
let mut contents = String::new();
let mut hashmap: HashMap<char, i32> = HashMap::new();
file.read_to_string(&mut contents)?;
for c in contents.chars() {
if let Some(value) = hashmap.get(&c) {
hashmap.insert(value, hashmap.get(value) + 1);
}
//println!("{:?}", contents.chars().nth(i));
}
/*
contents.push('é');
let mut file2 = File::create("fo.txt")?;
let test: i64 = 10000000;
//writeln!(file2, "{}", test)?;
file2.write_all(&test.to_be_bytes())?;
*/
Ok(())
}