結果
| 問題 | No.169 何分かかるの!? |
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-07 16:38:40 |
| 言語 | C (gcc 15.2.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 504 bytes |
| 記録 | |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 41,924 KB |
| 最終ジャッジ日時 | 2026-02-22 13:04:50 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 22 |
ソースコード
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LEN (256)
void uint2str(char str[], size_t len, double num) {
snprintf(str, len, "%f", num);
}
void main(void){
int k,s;
scanf("%d\n%d\n",&k,&s);
int remaining = 100 - k ;
double percentTime = s / remaining;
printf("1%当たりの時間:%f\n",s / remaining);
char numStr[MAX_LEN];
uint2str(numStr,MAX_LEN,percentTime * 100);
int i = 0;
while(numStr[i] != '.'){
printf("%c",numStr[i]);
i++;
}
}
Maeda