-
Notifications
You must be signed in to change notification settings - Fork 0
/
commission.cpp
36 lines (36 loc) · 936 Bytes
/
commission.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
char ch;
cin >> ch;
if(ch!='Y') {
cout << "TOTAL MEMBERS:1" << endl;
cout << "COMMISSION DETAILS" << endl;
cout << s << ": " << 5000*(0.05) << " INR" << endl;
}
else {
string temp;
getline(cin, temp);
int c=1;
vector<string> res;
string a = "";
for(int i=0;i<temp.size();i++) {
if(temp[i]!=',' && temp[i]!=' ')
a += temp[i];
else {
c++;
res.push_back(a);
a = "";
}
}
cout<<"TOTAL MEMBERS:"<<c<<endl;
cout<<"COMMISSION DETAILS"<<endl;
cout << s << ": " << 5000*(0.1) << " INR" << endl;
for(int i=0;i<res.size();i++) {
cout << res[i] << ": " << 5000*(0.05) << " INR" << endl;
}
}
return 0;
}