-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from hg398/master
Issue #457
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
// BY hg398 | ||
|
||
#include <bits/stdc++.h> | ||
using namespace std; | ||
#define ll long long int | ||
#define boost ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) | ||
#define FOR(i,a,b) for(int i=a;i<=b;i++) | ||
|
||
int main() { | ||
boost; | ||
int num; | ||
cin>>num; //input number | ||
bitset <64> bit_rep=num; //bitset to convert number into binary representation | ||
for(int i=63;i>=0;i--)cout<<bit_rep[i]; //printing binary representation | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
// BY hg398 | ||
|
||
#include <bits/stdc++.h> | ||
using namespace std; | ||
#define ll long long int | ||
#define boost ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) | ||
#define FOR(i,a,b) for(int i=a;i<=b;i++) | ||
|
||
int largest(int a,int b) | ||
{ | ||
return a*(bool)(a/b) + b*(bool)(b/a); | ||
} | ||
|
||
int main() { | ||
boost; | ||
int num1,num2; | ||
cin>>num1>>num2; | ||
if(num1==num2) | ||
cout<<num1; | ||
else | ||
cout<<largest(num1,num2); | ||
return 0; | ||
} |