結果
問題 |
No.3036 Nauclhlt型文字列
|
ユーザー |
![]() |
提出日時 | 2025-03-17 16:22:59 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 477 ms |
コンパイル使用メモリ | 25,216 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-17 16:23:01 |
合計ジャッジ時間 | 1,777 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
コンパイルメッセージ
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",&n); | ^~~~~~~~~~~~~~ main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s",s); | ^~~~~~~~~~~~~
ソースコード
#include <stdio.h> void main(void) { int n = 0; scanf("%d",&n); char s[100000] = "a"; scanf("%s",s); if(n%2 == 0){ printf("Yes\n"); for(int i = 0 ; i < n;i++){ if(i % 2 == 0){ printf("%c",s[i]); } } printf(" "); for(int i = 0 ; i < n;i++){ if(i % 2 == 1){ printf("%c",s[i]); } } }else { printf("No"); } }