Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
HotelVec
//g++ 7.4.0 ///////////////////////////////////////////////////////////////////////////// //HotelVec //this code is created by Rezaul Hoque on August 14,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 <vector> class Hotel{ std::vector<std::string> t; std::vector<std::string> s; std::vector<int> r; public: Hotel(){} Hotel(std::vector<std::string> nam,std::vector<std::string> st,std::vector<int> rent){ this->t=nam; this->s=st; this->r=rent; } ~Hotel(){} void addNam(std::string s){ t.push_back(s); } void addStar(std::string st){ s.push_back(st); } void addR(int n){ r.push_back(n); } void print() { for(int k=0;k<3;k++){ std::cout<<t[k]<<" "<<s[k]<<" "<<r[k]<<"\n"; } std::cout<<" \n"; } }; int main(){ Hotel h; h.addNam("XYZ");h.addStar("***");h.addR(1000); h.addNam("DEF");h.addStar("****");h.addR(2000); h.addNam("EFH");h.addStar("**");h.addR(500); h.print(); return 0; }
run
|
edit
|
history
|
help
0
SegTree
PriQTel2
dsu on tree (http://codeforces.com/contest/208/problem/E)
Bad Code2
rotation
KJ
PalindromeDay
cast operator
logcOperator
Simple use of function templete and namespace