Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n == -1 {
			break
		}
		if n == 0 {
			fmt.Println(0)
			continue
		}
		ans := make([]int, 0)
		for n > 0 {
			ans = append([]int{n % 4}, ans...)
			n = n / 4
		}

		buf := make([]string, len(ans))
		for i := range ans {
			buf[i] = strconv.Itoa(ans[i])
		}
		fmt.Println(strings.Join(buf, ""))
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
char f(int k) {
	if (k == 1)return '1';
	if (k == 2)return '2';
	if (k == 3)return '3';
	return '0';
}
int main() {
	int n;
	while (cin >> n) {
		if (n == -1)return 0;
		if (n == 0)cout << "0\n";
		else {
			string ans;
			while (n != 0) {
				ans = f(n % 4) + ans;
				n = (n - n % 4) / 4;
			}
			cout << ans << endl;
		}
	}
}

C++: #include <stdio.h>

int main(void)
{
int a[100];
int n;
int index;

while (1){
scanf("%d", &n);
if (n == -1) break;
index = 0;
do {
a[index++] = (n & 0x3);
n >>= 2;
} while (n != 0);

index--;
while (index >= 0){
printf("%d", a[index--]);
}

puts("");
}
}

C++: #include<iostream>
#include<algorithm>
using namespace std;

int main()
{
  int n, i;
  char c[20];
  while(true)
  {
    for(i = 0; i < 20; i++)
      c[i] = 0;
    cin >> n;
    if(!n)
    {
      cout << 0 << endl;
      continue;
    }
    for(i = 0; n > 0; i++)
    {
      c[i] = n % 4 + '0';
      n = n / 4;
    }
    reverse(c, c + i);
    cout << c << endl;
  }
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int n;
    while(cin>>n&&n!=-1){
        int ans=0;
        for(int i=0;;i++){
            ans+=(n%4*pow(10,i));
            if(n/4==0) break;
            n=n/4;
        }
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int main(){
    int n;
    while(cin>>n){
        if(n==-1){
            break;
        }
        int ans=0;
        for(int i=0;;i++){
            ans+=(n%4*pow(10,i));
            n=n/4;
            if(n%4==0) break;
        }
        
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
    int n;
    while(cin >> n){
        if(n == -1) break;
        
        if(n == 0){
            cout << 0 << endl;
            continue;
        }

        vector<int> res;
        while(n != 0){
            res.push_back(n%4);
            n /= 4;
        }

        reverse(res.begin(), res.end());
        for(int i : res)    cout << i;
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

string tofour(int n){
	string ans;
	while(n){
		ans += n%4+'0';
		n/=4;
	}
	reverse(ans.begin(),ans.end());
	return ans.size()?ans:"0";
}
int main(){
	int n;
	while(cin >> n , ~n){
		cout << tofour(n) << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stack>
#include<cstdio>
#include<map>
#include<functional>
#include <sstream>

using namespace std;

string ans;

string IntToString(int number)
{
    stringstream ss;
    ss << number;
    return ss.str();
}


string sinsuu(int n){
    ans += IntToString(n%4);
    if (n==0)
    {
        ans="0";
        return ans;
    }
    if( (n/4) < 4 )
    {
        ans += IntToString(n/4);
        reverse( ans.begin(), ans.end());
        return ans;
    }
    else
    {
        n = n/4;
        return sinsuu(n);
    }
}

int main(){
	int n;
    while (1)
    {
        cin>>n;
        if(n<0)break;
        cout<<sinsuu(n)<<endl;
        ans.clear();
        
    }
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
	int n;
	string s;

	while( cin >> n , (n != -1) ){
		s.clear();
		do{
			s.push_back( (n%4) + '0' );
			n /= 4;
		}while( n > 0 );
		reverse( s.begin() , s.end() );
		cout << s << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

int main()
{
    int n;
    while(cin >> n)
    {
        if(n == -1 ) break;

        vector<int> ans;
        if(n == 0) ans.push_back(0);
        
        while(n)
        {
            ans.push_back(n % 4);
            n /= 4;
        }
        

        int l = ans.size();
        REP(l) cout << ans[l - i - 1] ;
        cout<< endl;

    }
    return 0;
}

C++: #include<stdio.h>

#define N 4

void Nshinsu(int);

int main(){
  while(1){
    int n;
    scanf("%d",&n);
    if(n==-1)break;
    Nshinsu(n);
  }
  return 0;
}

void Nshinsu(int n){

  long long i,y=0,b=1;

  for(i=0;i<100;i++){    
    y+=(n%N)*b;
    n/=N;
    b*=10;
  }

  printf("%lld\n",y);
}

C++: #include <iostream>
#include <vector>

using namespace std;

void convert(int n, vector<int> *v) {
  if(n == 0) return;
  convert(n / 4, v);
  v->push_back(n % 4);
}

int main() {
  while(1) {
    int n;
    cin >> n;
    if(n == -1) break;

    vector<int> v;
    convert(n, &v);
    if(n == 0) v.push_back(0);
    for(int i = 0; i < v.size(); i++) {
      cout << v[i];
    }
    cout << endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int z[2222], x, kaisuu, m, kai;
	kaisuu = 0;
	while (1) {
		cin >> x;
		if (x == -1) {
			goto a;
		}
		kaisuu = kaisuu + 1;
		kai = 1;
		while (1) {
			m = x % 4;
			x = x - m;
			x = x / 4;
			if (kai == 1) {
				z[kaisuu] = m;
			}
			else {
				z[kaisuu] = z[kaisuu] + m * kai;
			}
			kai = kai * 10;
			if (x == 0) {
				goto aa;
			}
		}
	aa:;
	}
a:;
	for (int i = 1; i <= kaisuu; i++) {
		cout << z[i] << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

string four(int n){
	if(n==0)return "0";
	string ret;
	while(n){
		ret += (char)(n%4+'0');
		n/=4;
	}
	reverse(ret.begin(),ret.end());
	return ret;
}

int main(){
	int n;
	while(cin >> n && n != -1){
		cout << four(n) << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stack>
#include<cstdio>
#include<map>
#include<functional>
#include <sstream>

using namespace std;

string ans;

string IntToString(int number)
{
    stringstream ss;
    ss << number;
    return ss.str();
}


string sinsuu(int n){
    ans += IntToString(n%4);
    if (n==0)
    {
        ans="0";
        return ans;
    }
    if( (n/4) < 4 )
    {
        ans += IntToString(n/4);
        reverse( ans.begin(), ans.end());
        return ans;
    }
    else
    {
        n = n/4;
        return sinsuu(n);
    }
}

int main(){
	int n;
    while (1)
    {
        cin>>n;
        if(n<0)break;
        cout<<sinsuu(n)<<endl;
        ans.clear();
        
    }
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long int lli;

int main(){
  lli n;
  const int maxi = 1e5;
  while(std::cin >> n, n != -1){
    vector<int> digit(100000, 0);
    for (int i = 0; i < n; i++) {
      int p = 0;
      digit[0]++;
      while(digit[p] == 4){
        digit[p] = 0;
        digit[p + 1]++;
        p++;
      }
    }
    bool flag = true;
    for (int i = maxi - 1; i >= 0; i--) {
      if(digit[i] == 0 and flag)continue;
      flag = false;
      std::cout << digit[i];
    }
    if(flag == true)std::cout << 0 << std::endl;
    else std::cout << std::endl;
  }
    
  return 0;
}