Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define INF 1000010000
- #define nl '\n'
- typedef long long ll;
- ll gcd(ll a, ll b) {
- return b ? gcd(b, a % b) : abs(a);
- }
- ll lcm(ll a, ll b) {
- return abs( a / gcd(a, b) * b );
- }
- string DecToBin(int n){
- string ans = "";
- while(n != 0){
- ans = ((n % 2)?"1":"0") + ans;
- n/=2;
- }
- return ans;
- }
- int main() {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.precision(0);
- int n;
- cin >> n;
- string str = DecToBin(n);
- for( int i = 1 ; i < str.length() ; ++i )
- cout << "S" << ( str[i] == '1' ? "X" : "");
- return 0;
- }
Add Comment
Please, Sign In to add comment