結果

問題 No.224 文字列変更(easy)
コンテスト
ユーザー a2011404
提出日時 2017-03-15 15:38:50
言語 C11(gcc12 gnu拡張)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=gnu11 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 232 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 100 ms
コンパイル使用メモリ 31,964 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-08 16:09:59
合計ジャッジ時間 893 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:20: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘char (*)[10000]’ [-Wformat=]
    8 |         scanf("%d %s %s",&n,&s,&t);
      |                   ~^        ~~
      |                    |        |
      |                    char *   char (*)[10000]
main.c:8:23: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘char (*)[10000]’ [-Wformat=]
    8 |         scanf("%d %s %s",&n,&s,&t);
      |                      ~^        ~~
      |                       |        |
      |                       char *   char (*)[10000]
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d %s %s",&n,&s,&t);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>


int main(void){
	int n,i,count=0;
	char s[10000],t[10000];

	scanf("%d %s %s",&n,&s,&t);

	for(i=0;i<n;i++){
		if(s[i]!=t[i])	count++;
//		printf("%d=%c,%c\n",i,s[i],t[i]);
	}
	printf("%d\n",count);
	return 0;
}
0