結果
| 問題 |
No.224 文字列変更(easy)
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-18 09:31:17 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 276 bytes |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 25,728 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-18 09:31:19 |
| 合計ジャッジ時間 | 1,597 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d",&charNum);
| ^~~~~~~~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s %s",strA,strB);
| ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
void main(void) {
int charNum = 0;
scanf("%d",&charNum);
char strA[10000] = "a";
char strB[10000] = "b";
scanf("%s %s",strA,strB);
int count = 0;
for(int i = 0 ; i < charNum ; i++){
if(strA[i] != strB[i]){
count++;
}
}
printf("%d",count);
}
Maeda