結果

問題 No.285 消費税2
ユーザー ctyl_0ctyl_0
提出日時 2015-10-09 22:48:42
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 988 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 86,364 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 04:23:33
合計ジャッジ時間 1,427 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <string>
#include <sstream>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define var auto
#define mod 1000000007
typedef long long ll;

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << fixed << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

// end of template

int main() {
    // source code
    ll n;
    cin >> n;
    n *= 108;
    stringstream s;
    s << n;
    
    string str = s.str();
    
    string str1 = str.substr(0, str.size() - 2);
    
    string str2 = str.substr(str.size() - 2, 2);
    
    
    
    
    output(str1 + "." + str2, 0);
    
    return 0;
}
0