Monday, November 13, 2017

Second LargestCodechef Problem Solution

https://www.codechef.com/problems/FLOW017

In C++...........................................

    #include<bits/stdc++.h>

    using namespace std;

    int main()

    {
       int t,a,n;
       cin>>t;
       while(t--)
       {
           vector<int>num;
           for(int i=0;i<3;i++)
           {
               cin>>a;
               num.push_back(a);
           }
           sort(num.begin(),num.end());
           cout<<num[1]<<endl;
           num.clear();
       }
    }

No comments:

Post a Comment