I have a simple program as follows:
#include <iostream> using namespace std; int main() { int N; cout << "Enter N: " << endl; cin >> N; int acc = 0; cin >> acc; int min = acc; int max = acc; for (int i=1; i<N; i++) { int current; cin >> current; acc += current; if (current > max) { max = current; } else if (current < min) { min = current; } } cout << "Total: " + acc << endl; cout << "Max: " + max << endl; cout << "Min: " + min << endl; return 0; } My output is getting chopped off as follows
./stat Enter N: 3 1 2 3 : in: What am I doing wrong?