Най-добро постижение

Напишете програма, която позволява да се въведат постижението на 4-ма участници в дадено състезание, указано като реално число (например колко са скочили на дълъг или висок  скок, или времето за което са пробягали 100 м.) и отпечатва колко е най-доброто постижение.

По желание програмата може да отпечатва и на кой участник принадлежи то. Например: Най-добро постижение – 2.34 м, на участник No.3

 

Публикувано в 11а, 11в с етикети . Постоянна връзка.

3 Responses to Най-добро постижение

  1. dreanor каза:
    #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    { float a,max,c;
    cout << "Wuwedi postijenieto ";
    cin >>a;
    max=a;
    c=1;
    
    cout << "Wuwedi postijenieto ";
    cin >>a;
    if (a>max)
       {
              max=a;
              c=2;
       }
    cout << "Wuwedi postijenieto ";
    cin >>a;
    if (a>max)
       {
              max=a;
              c=3;
       }
    
    cout << "Wuwedi postijenieto ";
    cin >>a;
    if (a>max)
       {
              max=a;
              c=4;
       }
    
    cout<<"Nai-dobroto e "<<max<<" na uchastnik nomer "<<c<<endl;
        system("PAUSE");
        return EXIT_SUCCESS;
    }
    
  2. marant каза:
    #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        float a,b,c,d;
        cout<<"Vuvedi postijenieto na purviq y4astnik: "<<endl;
        cin>>a;
        cout<<"Vuvedi postijenieto na vtoriq y4astnik: "<<endl;
        cin>>b;
        cout<<"Vuvedi postijenieto na tretiq y4astnik: "<<endl;
        cin>>c;
        cout<<"Vuvedi postijenieto na tretiq y4astnik"<<endl;
        cin>>d;
        if ((a>b)&&(a>c)&&(a>d))
         cout<<"Purviq y4astnik vodi vtoriq s: "<<(a-b)<<"m. Tretiq s: "<<(a-c)<<"m. I 4etvurtiq s: "<<(a-d)<<"m"<<endl;
         if((b>a)&&(b>c)&&(b>d))
         cout<<"Vtoriq vodi purviq s: "<<(b-a)<<"m. Tretiq s: "<<(b-c)<<"m. I 4etvurtiq s: "<<(b-d)<<"m"<<endl;
         if((c>a)&&(c>b)&&(c>d))
         cout<<"Tretiq vodi vtoriq s: "<<(c-b)<<"m. purviq s: "<<(c-a)<<"m. I 4etvurtiq s: "<<(c-d)<<"m"<<endl;
        if ((d>a)&&(d>b)&&(d>c))
         cout<<"4etvurtiq vodi vtoriq s: "<<(d-b)<<"m. Tretiq s: "<<(d-c)<<"m. I purviqt s: "<<(d-a)<<"m"<<endl;
        system("PAUSE");
        return EXIT_SUCCESS;
    }
    
  3. LoL каза:
    #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    { 
        float a,max;
        cout<<"vuvedete postijeniata edno sled drugo"<<endl;
        cin>>a;
        max=a;
        cin>>a;
        if (a>max)
        max=a;
        cin>>a;
        if (a>max)
        max=a;
        cin>>a;
        if (a>max)
        max=a;
        cout<<"Nai dobroto postijenie e " <<max <<endl;
        system("PAUSE");
        return EXIT_SUCCESS;
    }
    

Вашият коментар