fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int sum=0;
  7. int a,b=0;
  8. int c=0;
  9. cin>>a;
  10. cin>>c;
  11. int min,max=c;
  12. for(int i=1;i<a;i++){
  13. cin>>b;
  14. sum+=b;
  15. if (min>b)
  16. min=b;
  17. if (max<b)
  18. max=b;
  19. }
  20. }
  21. cout<<sum<<" "<<min<<" "<<max<<endl;
  22. return 0;
  23. }
Compilation error #stdin compilation error #stdout 0s 3144KB
stdin
2
1
1
compilation info
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
 } 
 ^
stdout
Standard output is empty