結果
問題 | No.163 cAPSlOCK |
ユーザー |
![]() |
提出日時 | 2016-10-16 16:23:50 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 474 bytes |
コンパイル時間 | 14,364 ms |
コンパイル使用メモリ | 382,280 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 12:00:25 |
合計ジャッジ時間 | 14,147 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
fn getline() -> String{ let mut ret = String::new(); std::io::stdin().read_line(&mut ret).ok(); return ret; } fn capslock(c: char) -> String { match c { c if c.is_uppercase() => c.to_string().to_lowercase(), _ => c.to_string().to_uppercase(), } } fn convert(string: &str) -> String { string.chars().map(capslock).collect::<String>() } fn main() { let s = getline(); println!("{}", convert(s.trim())); }