Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- #include<fstream>
- using namespace std;
- union {
- int value;
- char ch[4];
- } input, result;
- int main() {
- //freopen("in.txt", "r", stdin);
- long int N;
- while(cin >> input.value) {
- for(int i = 0, j = 3; i < 4; i++, j--) result.ch[i] = input.ch[j];
- cout << input.value << " converts to " << result.value << "\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement