結果

問題 No.292 芸名
ユーザー suppy193
提出日時 2016-04-11 11:35:57
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 06:01:19
合計ジャッジ時間 677 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s%d%d", s, &t, &u);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	char s[51], s2[51];
	int t, u;
	int i, j;
	scanf("%s%d%d", s, &t, &u);
	i = 0;
	j = 0;
	while(s[i] != '\0'){
		if(i == t || i == u){
			i++;
			continue;
		}
		s2[j] = s[i];
		i++;
		j++;
	}
	s2[j] = '\0';

	printf("%s\n", s2);

	return 0;
}
0