結果

問題 No.668 6.0*10^23
ユーザー かぼちゃ
提出日時 2018-03-23 22:52:25
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 311 bytes
コンパイル時間 439 ms
コンパイル使用メモリ 60,272 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 05:17:32
合計ジャッジ時間 1,445 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34 WA * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:23: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wformat=]
   17 |     printf("%0.1f*10^%d",a,s.length()-1);
      |                      ~^    ~~~~~~~~~~~~
      |                       |              |
      |                       int            std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
      |                      %ld

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    
    string s;
    cin >> s;
    float a = 0;
    for(int i = 0;i < 3;i++){
        a *= 10;
        a += s[i] - '0';
    }
    a/=100;
    printf("%0.1f*10^%d",a,s.length()-1);
    return 0;
}

0