일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- 예전글 #CNN
- web
- Bob
- PS
- 예전글
- pwnable
- blind-sqli
- cce2023
- Pwnable.kr
- cryptohack.org
- XSS
- SQLi
- pwn.college
- JS
- cookie
- HTB
- SECGAME
- 백준
- regex
- webhacking.kr
- pwn
- blind_sqli
- 예전글 #PS
- Crypto
- Today
- Total
목록PS (3)
아모에요

f32로 제출하면 오차범위에 의해서 틀렸다고 채점된다. 1 2 3 4 5 6 7 8 9 10 use std::io; fn main(){ let mut s = String::new(); io::stdin().read_line(&mut s).unwrap(); let li: Vec = s.split_whitespace().collect(); let a = li[0].parse::().unwrap(); let b = li[1].parse::().unwrap(); println!("{}",a/b) } Colored by Color Scripter cs

unwrap()를 안해줬더니 컴파일 시 에러가 발생한다. 1 2 3 4 5 6 7 8 9 10 use std::io; fn main(){ let mut s = String::new(); io::stdin().read_line(&mut s).unwrap(); let li: Vec = s.split_whitespace().collect(); let a = li[0].parse::().unwrap(); let b = li[1].parse::().unwrap(); println!("{}",a-b); } Colored by Color Scripter cs

ID dys4nt로 새로운 백준 PS 계정을 만들었다. Rust 언어를 공부할 겸 Rust로 solved.ac CLASS들을 깨보겠다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 use std::io; fn main(){ let mut s = String::new(); io::stdin().read_line(&mut s); let li = s.split_whitespace(); let mut x: i32 = 0; for num in li{ x += num.parse::().unwrap(); } println!("{}",x); } Colored by Color Scripter cs use std::io를 이용해서 stdin, stdout를 사용한다. mutable(가변) 변수 s를 Stri..