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

Ended

Participants:154

Verdict:Accepted
Score:100 / 100
Submitted:2018-04-08 12:18:18

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
28
29
30
#include<bits/stdc++.h>
using namespace std;
long long a,b,c;
set<int>s;
int main()
{
    cin>>a>>b;
    for(int i=0;i<1000;i++){
        a=a%b;
        a*=1000000000000;
        c=a/b;
        //cout<<c<<endl;
        int cnt=0;
        while(c){
            s.insert(c%10);
            c/=10;
        }
    }
    set<int>::iterator it=s.begin();
    while(it!=s.end()){
        cout<<*it;
        it++;
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX