#include <iostream>using namespace std; int main() { // your code goes here int sum=0; int a,b=0; int c=0; cin>>a; cin>>c; int min,max=c; for(int i=1;i<a;i++){ cin>>b; sum+=b; if (min>b) min=b; if (max<b) max=b; } } cout<<sum<<" "<<min<<" "<<max<<endl; return 0;}
2 1 1
prog.cpp:21:2: error: 'cout' does not name a type cout<<sum<<" "<<min<<" "<<max<<endl; ^ prog.cpp:22:2: error: expected unqualified-id before 'return' return 0; ^ prog.cpp:23:1: error: expected declaration before '}' token } ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!