Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func maxValue(p []int) int {
	highest := 0
	for i := 0; i < len(p); i++ {
		if p[i] > highest {
			highest = p[i]
		}
	}
	return highest
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		n := nextInt()
		m := nextInt()
		if n == 0 && m == 0 {
			break
		}

		pSum := make([]int, n)
		for i := 0; i < m; i++ {
			for j := 0; j < n; j++ {
				pSum[j] += nextInt()
			}
		}
		fmt.Println(maxValue(pSum))
	}
}

C++: #include<iostream>
#include<stdio.h>
#include<cctype>
#include<string>

using namespace std;

int main()
{
  int n,m;

  while(1){
    
    int high=0,p[50][1000];

    cin>>n>>m;
    if(n==0 && m==0)return 0;
    for (int i=0;i<m;i++){
      for(int j=0;j<n;j++){
	cin>>p[i][j];
      }
    }

    for (int i=0;i<n;i++){
      int s=0;
      for(int j=0;j<m;j++){
	s+=p[j][i];
      }
      if(high<s){
	high=s;
	}
    }
    cout<<high<<endl;
  }
      return 0;
  
}

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

using namespace std;

#define N 1000
#define M 50

void init();

int point[M][N];

int main(){
    int student,subject,sum;
    vector<int> total;
    vector<int> res;

    init();
    total.clear();

    while(1){
        cin>>student>>subject;
        if((student==0) && (subject==0)) break;
        
        init();
        for(int i=0;i<subject;i++){
            for(int j=0;j<student;j++){
                cin>>point[i][j];
            }
        } 

        for(int i=0;i<student;i++){
            sum = 0;
            for(int j=0;j<subject;j++){
                sum+= point[j][i];
            }
            total.push_back(sum);
        }

        sort(total.begin(),total.end());
        res.push_back(total[student-1]);
        total.clear();
    }

    for(int i=0;i!=res.size();i++){
        cout<<res[i]<<endl;
    }

    return 0;
}

void init(){
    for(int i=0;i<M;i++){
        for(int j=0;j<N;j++){
            point[i][j] = 0;
        }
    }
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;

void solve (int n, int m) {
    vector<vector<int>> score(n, vector<int>(m));
    rep(i, m) rep(j, n) cin >> score[j][i];
    int ans = 0;
    rep(i, n) ans = max(ans, accumulate(score[i].begin(), score[i].end(), 0));
    cout << ans << '\n';
}

int main() {
    int n, m;
    while(cin >> n >> m) {
        if(!n) break;
        solve(n, m);
    }
    return 0;
}

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

int main(){
    int N,M;
    while(cin >> N >> M && N){
        vector<vector<int>> P(M+1,vector<int>(N+1,0));
        for(int i=1;i<=M;i++){
            for(int j=1;j<=N;j++){
                cin >> P[i][j];
            }
        }
        int ans = 0;
        for(int j=1;j<=N;j++){
            int sum = 0;
            for(int i=1;i<=M;i++){
                sum += P[i][j];
            }
            ans = max(ans,sum);
        }
        cout << ans << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int sum[1005];
int main() {
    int n, m;
    while(true) {
        cin >> n >> m;
        if(n == 0) break;
        for(int i = 1; i <= n; i++) sum[i] = 0;
        for(int i = 1; i <= m; i++) {
            for(int j = 1; j <= n; j++) {
                int now;
                cin >> now;
                sum[j] += now;
            }
        }
        int maxi = 0;
        for(int i = 1; i <= n; i++) {
            maxi = max(maxi, sum[i]);
        }
        cout << maxi << endl;
    }
}

C++: #include <bits/stdc++.h>

typedef long long ll;
#define ALL(a) a, a+sizeof(a)/sizeof(a[0])
#define all(a) a.begin(),a.end()
#define MOD 1000000007
using namespace std;
ll gcd(ll n, ll m) {
	if (m == 0) return n;
	return gcd(m, n % m);
}
ll lcm(ll n, ll m) {return m / gcd(n, m) * n;}

int main(void) {
	int n,m,tmp;
	while (1) {
		cin >> n >> m;
		if (n == 0 && m == 0) break;
		vector<int> point(n);
		for (int i = 0; i < n; i++) point[i] = 0;
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < n; j++) {
				cin >> tmp;
				point[j] += tmp;
			}
		}
		cout << *max_element(all(point)) << "\n";
	}
	return 0;
}

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

static int n;
static int m;
static int d[1000];

int main()
{
	for (;;) {
		scanf("%d%d", &n, &m);
		if (n == 0 && m == 0) {
			break;
		}
		fill(d, d + n, 0);

		for (int i = 0; i < m; ++i) {
			for (int j = 0; j < n; ++j) {
				int e;
				
				scanf("%d", &e);
				d[j] += e;
			}
		}
		printf("%d\n", *max_element(d, d + n));
	}

	return EXIT_SUCCESS;
}

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

template <typename T>
class matrix: public std::vector< std::vector<T> >
{
public:
	matrix(int m = 0, int n = 0, const T& v = T()):
		std::vector< std::vector<T> >(m, std::vector<T>(n, v)) {}
	int rows() const {return this->size();}
	int cols() const {return rows() == 0 ? 0 : this->at(0).size();}
};

template <typename T>
std::istream& operator>>(std::istream& is, matrix<T>& M)
{
	for (int i = 0; i < M.rows(); ++i)
		for (int j = 0; j < M.cols(); ++j)
			is >> M[i][j];
	return is;
}

int main()
{
	int m, n;
	while (std::cin >> n >> m && !(m == 0 && n == 0))
	{
		matrix<int> M(m, n);
		std::cin >> M;
		int maxs = 0;
		std::vector<int> s(n);
		for (int i = 0; i < n; ++i)
		{
			for (int j = 0; j < m; ++j)
				s[i] += M[j][i];
			if (maxs < s[i])
				maxs = s[i]; 
		}
		std::cout << maxs << '\n';
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
typedef pair<int,int> P;
#define INF 1e9

int main(){
    int n,m;
    while(cin>>n>>m){
        if(n==0)break;
        int p[m][n];
        for(int i=0;i<m;i++){
            for(int j=0;j<n;j++){
                cin>>p[i][j];
            }
        }
        int ans = 0;
        int res = 0;
        for(int i=0;i<n;i++){
            ans = 0;
            for(int j=0;j<m;j++){
                ans += p[j][i];
            }
            res = max(res,ans);
        }
        cout<<res<<endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
using Int = long long;
int PREP = (cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(9), 0);
//int SEGV = getenv("D") || (exit(system("D= SEGFAULT_SIGNALS=all catchsegv ./prog.exe") >> 8), 0);
int main() {
    for (;;) {
        int N, M; cin >> N >> M;
        if (N == 0 && M == 0) break;
        vector<int> score(N);
        for (int i = 0; i < M; i++) {
            for (int j = 0; j < N; j++) {
                int p; cin >> p;
                score[j] += p;
            }
        }
        cout << *max_element(begin(score), end(score)) << '\n';
    }
    return 0;
}