zadc5
gorazd
c_cpp
10 months ago
654 B
3
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;
}Editor is loading...
Leave a Comment