結果

問題 No.668 6.0*10^23
コンテスト
ユーザー posaune-0xa0
提出日時 2018-06-27 17:03:22
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 461 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 176 ms
コンパイル使用メモリ 37,184 KB
最終ジャッジ日時 2026-02-22 01:17:02
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

int main(void)
{
    char str[101010];
    scanf("%s", str);
    long c;
    int a = (int)str[0]-48, b = (int)str[1]-48;
    for(c=0; str[c] != '\0'; c++);
    if((int)str[2]-48 >= 5)
    {
        b++;
        if(b == 10)
        {
            b = 0;
            a++;
            if(a == 10)
            {
                a = 1;
                c++;
            }
        }
    }

    printf("%d"".""%d*10^%ld", a, b, c-1);
    return 0;
}
0