結果
問題 |
No.587 七対子
|
ユーザー |
![]() |
提出日時 | 2018-02-08 17:23:52 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 537 bytes |
コンパイル時間 | 826 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 17:20:22 |
合計ジャッジ時間 | 1,906 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 25 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%s",s); | ^~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(void) { char s[20]; int i,j; int x[20]; int c=0; int q=0; int a=0; int l; char temp; scanf("%s",s); l=strlen(s); for(i=0;i<l;i++){ for(j=0;j<l;j++){ if(s[i]==s[j]){ c++; } } x[i]=c; c=0; } for(i=0;i<l;i++){ if(x[i]%2!=0){ q++; temp=s[i]; } /*if(l-1==i&&q==1){ prin }*/ } if(q==1){ printf("%c\n",temp); }else{ printf("impossible\n"); } return 0; }