結果
| 問題 |
No.423 ハムスター語初級(数詞)
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-10-19 23:22:20 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 233 bytes |
| コンパイル時間 | 338 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-23 05:38:19 |
| 合計ジャッジ時間 | 895 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 9 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",s);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int n=0, a=0, b=2;
char s[51];
scanf("%s",s);
while(s[++n]!='\0');
n--;
while(n>0){
a += s[n] == 'u'? b : 0;
b*=2;
n -= s[n] == 'u'? 4 : 3;
}
printf("%d\n", a);
return 0;
}
mosmos_21