jeudi 26 septembre 2019

Writing program, importing three float a, b and c. sort in ascending order

#include <iostream>
using namespace std;

int main()
{
    float a,b,c,maxx,minn;
    cin>>a>>b>>c;
    maxx=a;
    if (b>maxx) (maxx=b);
    if (c>maxx) (maxx=c);
    minn=b;
    if (a<minn) (minn=a);
    if (c<minn) (minn=c);
    cout<<minn<<" "<<maxx ;
}

I don't know how to print the number between max and min.

Aucun commentaire:

Enregistrer un commentaire