結果

問題 No.224 文字列変更(easy)
ユーザー fujita
提出日時 2023-05-09 15:51:24
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 46 ms / 5,000 ms
コード長 764 bytes
コンパイル時間 6,680 ms
コンパイル使用メモリ 167,312 KB
実行使用メモリ 184,420 KB
最終ジャッジ日時 2024-11-26 02:27:20
合計ジャッジ時間 8,521 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (96 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var S = Console.ReadLine();
            var T = Console.ReadLine();
            int count = 0;
            //string[] strings1= new string[n];
            //string[] strings2 = new string[str.Length];

            for(int i = 0; i < n; i++)
            {
                if(S.Substring(i , 1) == T.Substring(i , 1))
                {
                    continue;
                }
                else if (!(S.Substring(i, 1) == T.Substring(i, 1)))
                {
                    count++;
                }
            }
            Console.WriteLine(count);     
        }
    }
}
0