結果

問題 No.2041 E-mail Address
ユーザー Maeda
提出日時 2025-03-17 10:06:49
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 585 ms
コンパイル使用メモリ 25,088 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-17 10:06:51
合計ジャッジ時間 1,134 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 3 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%s",eMail);
      |         ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
void main(void){
	char eMail[1000000] = "a";
	scanf("%s",eMail);
	bool atSignFlg = false;
	for(int i = 0 ; i < (int)strlen(eMail);i++){
		if(!atSignFlg){
			if(eMail[i] != '('){
				printf("%c",eMail[i]);
			}else{
				atSignFlg = true;
			}
		}else{
			if(eMail[i] == ')'){
				atSignFlg == false;
				printf("@");
				continue;
			}
		}
	}
}
0