zadc5

 avatar
user_1041599
c_cpp
a month ago
654 B
1
Indexable
2kolok_SP
#include <iostream>
#include <cctype>
#include <string.h>
using namespace std;

int main() {
    float suma;
    cin >> suma;
    cin.ignore();
    char s[100];
    //cin.getline(c, 10);
    //cout<<c;
    float maxKoef = 0;
    char maxTip[10];
    int maxTip_;
    while (cin>>s) {
        if (*s == '#')
            break;
        int tip;
        float koef;
        cin>>tip>>koef;
        //cout<<s<<" "<<tip<<" "<<koef<<endl;
        suma *= koef;
        if (koef>maxKoef) {
            maxKoef = koef;
            strcpy(maxTip, s);
            maxTip_ = tip;
        }
    }
    cout<<maxTip<<" "<<maxTip_<<" "<<maxKoef<<endl;
    cout<<suma;
}
Leave a Comment