結果
問題 |
No.587 七対子
|
ユーザー |
![]() |
提出日時 | 2018-02-08 17:40:18 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 578 bytes |
コンパイル時間 | 239 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 17:21:06 |
合計ジャッジ時間 | 988 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 WA * 5 |
コンパイルメッセージ
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&&x[i]<3){ q++; temp=s[i]; //printf("%d%c\n",x[i],temp); } /*if(l-1==i&&q==1){ prin }*/ } if(q==1){ printf("%c\n",temp); }else{ printf("Impossible\n"); } return 0; }