結果

問題 No.1469 programing
ユーザー harurun
提出日時 2021-04-03 17:58:45
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 295 bytes
コンパイル時間 10,965 ms
コンパイル使用メモリ 395,272 KB
実行使用メモリ 11,640 KB
最終ジャッジ日時 2024-12-25 04:15:37
合計ジャッジ時間 12,656 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 1 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `a`
  --> src/main.rs:13:9
   |
13 |     let a=i;
   |         ^ help: if this is intentional, prefix it with an underscore: `_a`
   |
   = note: `#[warn(unused_variables)]` on by default

ソースコード

diff #

fn main(){
  let s = {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim_end().to_owned()
  };
  let a=s.chars().next().unwrap();
  print!("{}",a);
  for i in s.as_str().chars(){
    if i!=a{
      print!("{}",i);
    }
    let a=i;
  }
  print!("\n");
}
0