結果
| 問題 | No.432 占い(Easy) |
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-10-14 22:40:10 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-22 07:38:58 |
| 合計ジャッジ時間 | 1,073 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 5 WA * 17 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:9:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d", &s);
| ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int n,i,s,t,u,a;
scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%d", &s);
while(s>9){
t=s; s=0; u = 1;
while(t > 9){
a = t%10 + (t/10) % 10;
s += a>9 ? (a/10+a%10)*u : a*u;
u *= 10;
t /= 10;
}
}
printf("%d\n",s);
}
return 0;
}
mosmos_21