diff options
| author | Aditya Naik | 2018-05-10 00:15:29 -0400 |
|---|---|---|
| committer | Aditya Naik | 2018-05-10 00:15:29 -0400 |
| commit | 631ca6817d552db1725c7d6a445705f709302139 (patch) | |
| tree | 4ed1e943305fd5ff0772336034ee2a47458e68cc /10141 | |
| parent | 42fe0d8a06c1cecb7771823b9ae51220c469dc82 (diff) | |
reorg
Diffstat (limited to '10141')
| -rwxr-xr-x | 10141/rfp | bin | 0 -> 63128 bytes | |||
| -rw-r--r-- | 10141/rfp.cpp | 37 | ||||
| -rw-r--r-- | 10141/rfp.in | 32 |
3 files changed, 69 insertions, 0 deletions
diff --git a/10141/rfp b/10141/rfp Binary files differnew file mode 100755 index 0000000..d71b577 --- /dev/null +++ b/10141/rfp diff --git a/10141/rfp.cpp b/10141/rfp.cpp new file mode 100644 index 0000000..2a4f918 --- /dev/null +++ b/10141/rfp.cpp @@ -0,0 +1,37 @@ +#include <iostream> +#include <string> +using namespace std; + +int main(){ + float req, pro; + cin>>req>>pro; + int rfpnum=0; + while(req>0) + { + int i, j, k; + float cost,curcost=1000000000, comp, curcomp=0, numcomp; + string trash, curname, name; + ++rfpnum; + for(i=0; i<=req; i++) + getline(cin, trash); + + for(j=0; j<pro; j++){ + getline(cin, name); + cin>>cost>>numcomp; + comp = numcomp/req; + + if(comp>curcomp || (comp==curcomp && cost<curcost)){ + curname = name; + curcomp = comp; + curcost = cost; + } + + for(k=0;k<=numcomp;k++) + getline(cin, trash); + } + if(rfpnum>1) cout<<"\n"; + cout<<"RFP #"<<rfpnum<<"\n"<<curname<<"\n"; + cin>>req>>pro; + } + return 0; +} diff --git a/10141/rfp.in b/10141/rfp.in new file mode 100644 index 0000000..f0bc2d6 --- /dev/null +++ b/10141/rfp.in @@ -0,0 +1,32 @@ +6 4 +engine +brakes +tires +ashtray +vinyl roof +trip computer +Chevrolet +20000.00 3 +engine +tires +brakes +Cadillac +70000.00 4 +ashtray +vinyl roof +trip computer +engine +Hyundai +10000.00 3 +engine +tires +ashtray +Lada +6000.00 1 +tires +1 1 +coffee +Starbucks +1.50 1 +coffee +0 0
\ No newline at end of file |
