Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
698 B
10
Indexable
Never
#include <iostream>

using namespace std;


float fun_prix(float b )
{
 float a = 0.025;
 float prix  = a * b ;
 int prix2 = prix;
 return prix2;

}
int main()
{

    float dist;
    cin >> dist;

    if (dist <1000 )
    {
     cout << dist <<":"<< endl;
     cout << fun_prix(dist)+120<<" DA\n";
    }
     else   if (dist >=1000 && dist < 2000 )
    {
     cout << dist <<":"<< endl;
     cout << fun_prix(dist)+125<<" DA\n";
    }

    else if (dist >= 2000 && dist <= 8500)
    {
     cout << dist << ": "<< endl;
     cout << fun_prix(dist)+200<<" DA\n";
   }

   else if (dist >= 8500)
    {
     cout << dist << ": "<< endl;
     cout << fun_prix(dist)+30<<" DA\n";
   }



    return 0;
}