Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
AgeGroupHisto
//g++ 7.4.0 ////////////////////////////////////////////////////////////////////////////////AgeGroupHisto: example of system generated current time and printing histogram //this code is created by Rezaul Hoque on June 01,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 <iomanip> #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<int,int> a{{1,10},{2,10},{3,20},{3,25},{4,30},{5,60}}; std::cout<<"Age group Respondents:\n"; std::cout<<"___________________________\n"; std::cout<<" Responsents Histo\n"; std::cout<<"____________________________\n"; for(auto p: a){ std::cout<<std::fixed<<std::setprecision(1)<<p.first/2.0*10<<"-"<<(p.first+1)/2.0*10; std::cout<<" "<<p.second<<" |"<<std::string(p.second/10,'+')<<"\n";} return 0; }
run
|
edit
|
history
|
help
0
Full System Specifications
Minimum Vertices to Traverse Directed Graph
C++ virtual dispose
hacker
Hi
Test 16(2020)
Microsoft - MaxEmployeeAttendence (R repititions - 1st step towards DP solution)
TempBubbleDouble
2720
Test 13(2020)