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 <stdio.h>

int main(void) {

  int n;

  int quo;
  int digit[20];

  int i,num;

  while(1) {

    scanf("%d",&n);

    if(n==-1) break;

    quo=n;
    num=0;

    if(quo==0) {
      
      printf("0\n");
      continue;

    }

    while(quo>0) {

      digit[num]=quo%4;
      quo/=4;

      num++;

    }
    
    for(i=num-1;i>=0;i--) printf("%d",digit[i]);

    puts("");

  }

  return 0;

}

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

int main() {
	int n; cin >> n; stack<int> st; int temp;
	while (n != -1) {
		if (n == 0) cout << "0" << flush;
		else {
			while (n >= 1) {
				st.push(n % 4); n = n / 4; temp++;
			}
			for (int i = 0; i < temp; i++) {
				cout << st.top() << flush; st.pop();
			}
		}
		cout << endl; cin >> n; temp = 0;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
using namespace std;

const int INF = 1e9;
typedef long long ll;

int main(void){
  int n;
  while(cin >> n && n != -1){
    string quaternary("");
    while(n != 0){
      quaternary.insert(quaternary.begin(), 1, (n % 4) + '0');
      n /= 4;
    }
    if(quaternary == "") quaternary = "0";
    cout << quaternary << endl;
  }
  return 0;
}

C++: #include<stdio.h>

void yonshinsu(int);

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

void yonshinsu(int n){

  int i,y=0,b=1;

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

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

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

int main()
{
	int n;
	
	while(scanf("%d", &n),n != -1){
		char adic[1000];
		int i = 0;
		
		while(n > 0){
			adic[i] = n%4 + '0';
			n /= 4;
			i++;
		}
		
		reverse(adic, adic+i);
		
		printf("%s\n", adic);
	}
	
	return(0);
}

C++: #include <iostream>
#include <stack>
using namespace std;
int main(){
	stack<int> a;
	int n;
	while(cin>>n && n!=-1){
		while(n){
			a.push(n%4);
			n/=4;
		}
		while(a.empty() != true){
			cout<<a.top();
			a.pop();
		}
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main(){
	int n;
	while(cin >> n) {
		if(n == -1) break;
		int N = 0;
		while((int)pow(4,N) <= n) N++;
		N--;
		while(N > 0) {
			cout << n / (int)pow(4,N);
			n -= (n / (int)pow(4,N)) * (int)pow(4,N);
			N--;
		}
		cout << n << endl;
	}
	return 0;
}

C++: #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n;
    while(cin>>n, n>=0){
        string hoge;
        int yebi=n;
        while(1){
            string t=to_string(yebi%4);
            hoge.push_back(t[0]);
            if(!(yebi/4))break;
            yebi/=4;
        }
        reverse(all(hoge));
        cout<<hoge<<endl;
    }
}

C++: #include<iostream>
#include<cstdio>
#include<string>

using namespace std;

int main(void){
	while(1){
		int n;
		string str;
		scanf("%d",&n);
		if(n==-1)break;
		if(n==0)cout << "0" << endl;
		else{
			while(n>0){
				str+=n%4+'0';
				n=n/4;
			}
			reverse(str.begin(),str.end());
			cout << str << endl;
		}
	}
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(void){
	while(1){
		int n;
		string str;
		scanf("%d",&n);
		if(n==-1)break;
		if(n==0)cout << "0" << endl;
		else{
			while(n>0){
				str+=n%4+'0';
				n=n/4;
			}
			reverse(str.begin(),str.end());
			cout << str << endl;
		}
	}
    return 0;
}

C++: #include<cstdio>
using namespace std;
int main(void){
	int i,j,n,A[1000000];
	char str[1000];

	for( ; ; ){
		fgets(str,sizeof(str),stdin);
		sscanf(str,"%d",&n); i=0;
		if(n== -1) break;
		while(n!=0){
			A[i]=n%4;
			n/=4;
			i+=1;			
		}
		if(str[0]=='0')
			printf("%d",n);			
		else{
			for(j=i-1;j>=0;j--)
				printf("%d",A[j]);}
		printf("\n");
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

	int n;
	int k;

	while(1){
		cin>>n;
		if(n==-1) break;
		for(k=1;k*4<=n;k*=4);
		if(k!=0){
			while(1){
				if(k!=0) cout<<n/k;
				else break;
				n-=(n/k)*k;
				k/=4;
			}
		}
		else cout<<"0";
		cout<<endl;
	}

}

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

int main()
{
	int n,l,i; int s[32];
	while(cin >> n, n!=-1)
	{
		if(!n) 
		{
			cout << 0 << endl;
			continue;
		}

		for(i=0; n; i++)
		{
			s[i]=n&3; n>>=2;
		}
		for(i--; i>=0; i--)
		{
			cout << s[i];
		}
		cout << endl;
	}
}

C++: #include<stdio.h>
int main()
{
	int a,b[100],c=0;
	scanf("%d",&a);
	while(a!=-1){
	while(a>0){
		b[c]=a%4;
		a=a/4;
		c++;
	}
	for(int j=c-1;j>=0;j--){
		printf("%d",b[j]);
	}
	printf("\n");
	scanf("%d",&a);
	}
	return 0;
}

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

int main(){
  int a;
  while(cin >> a, a>=0){
    vector<int> ans;
    if(a==0)ans.push_back(0);
    while(a){
      ans.push_back( a%4 );
      a/=4;
    }
    reverse(ans.begin(),ans.end());
    for(int i=0;i<(int)ans.size();i++) cout << ans[i]; cout << endl;
  }
}

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

int main(){
  int n;
  while(cin >> n && n != -1){
    vector<int> res;
    int b = 4;
    if(n==0) {
      cout << 0 << endl;
      continue;
    }
    while(n > 0){
      res.push_back(n%4);
      n /= 4;
    }
    for(int i = 0; i < (int)res.size(); i++){
      cout << res[res.size() - 1 - i];
    }
    cout << endl;
  }
  return 0;
}

C++: #include <stdio.h>
int main(){
    long int a,b,c[1024]={0},i,j;
        
        scanf("%ld\n",&a);
        do{
        i=0;
    if(a==0){
        printf("0\n");
    }
        else if (a!=-1){
        b=a;
                do{
                
        
            a=b%4;
            b/=4;
                        c[i++]=a;
                        //printf("%d",a);
                }while(b>3);
                if(b!=0)
                c[i]=b;
                for(j=i;j>=0;j--){
                        printf("%ld",c[j]);
                }
                printf("\n");
        }
        else{
                break;
        }
        scanf("%ld\n",&a);
        }while(1);
        return 0;
}