Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
DailyGroceryHisto
//g++ 7.4.0 ////////////////////////////////////////////////////////////////////////////////DailyGroceryHisto: example of system generated current time and printing histogram //this code is created by Rezaul Hoque on May 31,2022; //contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com //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 <ctime> #include <map> #include <random> int main() { time_t t; t=time(0); std::cout<<"Date:\n"; std::cout<<ctime(&t); std::cout<<"___________________________\n"; std::random_device rd; std::map<std::string,int> a{{"Flour ",45},{"Rice ",48},{"Egg ",40},{"Milk ",80},{"Potato",20},{"Soap ",23}}; std::cout<<"Daily Grocery Item Price:\n"; std::cout<<"___________________________\n"; std::cout<<"Item Price Histo\n"; std::cout<<"____________________________\n"; for(auto p: a) std::cout<<p.first<<" "<<p.second<<"| "<<std::string(p.second/10,'+')<<"\n"; return 0; }
run
|
edit
|
history
|
help
0
fcyyfc
p30
ExceptionHandling2
GCC bug #79511
Find the max and min number in array
32bit
Procesos estocasticos Beta 2.0
test if nullptr
Pairs with given sum
Trapping rain water problem