Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream fin("coduri.in");
- ofstream fout("coduri.out");
- void baza2(int n)
- {
- int n10=0, n2=0, p=1;
- while(n)
- {
- n10+=p*(int(n))%10;
- p*=16;
- n/=10;
- }
- deque<int>a(1);
- while(n10)
- a.push_front(n10%10), n/=10;
- for(int i=1;i<a.size();++i) fout << a[i];
- fout << "\n";
- }
- void baza16(int n)
- {
- }
- int main()
- {
- int n, H, B, nr;
- char Cod;
- fin >> n >> H >> B;
- for(int i=1;i<=n;++i)
- {
- fin >> Cod;
- if(Cod=='H') fin >> nr, baza2(nr);
- if(Cod=='D') fin >> nr, baza16(nr);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement