結果

問題 No.224 文字列変更(easy)
コンテスト
ユーザー vjudge1
提出日時 2026-01-03 17:44:08
言語 Java
(openjdk 25.0.1)
結果
WA  
実行時間 -
コード長 832 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,996 ms
コンパイル使用メモリ 81,948 KB
実行使用メモリ 47,800 KB
最終ジャッジ日時 2026-01-03 17:44:15
合計ジャッジ時間 6,114 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n, count = 0;
        String S, T;

        n = sc.nextInt();
        S = sc.next();
        T = sc.next();

        while (n < 1 || n > 1000) {
            n = sc.nextInt();
        }

        while (!(S.length() == n || T.length() == n)) {
            System.out.println("Taking input again");
            S = sc.next();
            T = sc.next();
        }

        String[] original = S.split("");
        String[] arrayT = T.split("");

        for (int i = 1; i < arrayT.length; i++) {
            if (original[i].equalsIgnoreCase(arrayT[i])) {
                
            } else {
                count++;
            }

        }
        System.out.println(count);

    }
}
0