You are viewing a single comment's thread. Return to all comments →
Exactly my solution, though I did it in c
#include <stdio.h> #include <limits.h> int main(){ int inp,largest=0,smallest=INT_MAX; unsigned sum=0; for(int i = 0; i < 5; i++){ scanf("%d",&inp); if(inp>largest) largest = inp; if(inp<smallest) smallest = inp; sum+=inp; } printf("%u %u\n",sum-largest,sum-smallest); }
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
Exactly my solution, though I did it in c