[Offer收割]编程练习赛54 register

Ended

Participants:154

Verdict:Wrong Answer
Score:0 / 100
Submitted:2018-04-08 14:29:20

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <iomanip>
#include <ios>
using namespace std;
int main(int argc, const char * argv[]) {
    long double P,Q;
    vector<int> a;
    cin>>P>>Q;
    long double T=P/Q;
    cout.precision (20);
    for (int i=0;i<10;i++){
        a.push_back(10*(i+1)*T);
        T=10*T-int(10*T);
    }
    sort(a.begin(),a.end());
    a.erase( unique( a.begin(), a.end() ), a.end() );
    for (int j=0;j<a.size();j++){
        cout<<a[j];
    }
    cout<<"\n";
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX