Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
cppPyEnum
//g++ 7.4.0 //cppPyEnum: C++ equivalent of PyEnum program (created on January 10,2022) //this code is created by Rezaul Hoque on January 11,2022;contact: jewelmrh@yahoo.com,Dhaka, Bangladesh //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <iostream> #include <string> #include <map> using namespace std; enum Taka {Paise,Ana, CharAna,Siki,Adhuli,AatAna,SholoAna}; int main() { std::map<Taka, double> a ={ {Paise,1.0}, {Ana,6.25}, {CharAna,25.0}, {Adhuli,50.0}, {AatAna,50.0}, {SholoAna,100.0} }; const int n=6; std::string b[n]={"Paise","Ana","CharAna","Adhuli","AatAna","SholoAna"}; map<Taka,double>::iterator it; for(it=a.begin();it!=a.end();it++) std::cout<<b[it->first]<<"\t"<<it->second<<"\n"; return 0; }
run
|
edit
|
history
|
help
0
Using copy_n
basic observation leads to dp OPTIMIZATION from O(n^3) to O(n^2) !!! (sopj : AMBLE)
project euler problem - 3
series
container access all elements
Facebook - Split into monotonic sequences
project: bank account
Shultz_Lab1.CPP
Simple use of function templete and namespace
funpointer