Advertisement
_takumi

LectureTitle

Sep 6th, 2019
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Specialization {
  5.     string value;
  6.     explicit Specialization(const string& s) {
  7.         value = s;
  8.     }
  9. };
  10.  
  11. struct Course {
  12.     string value;
  13.     explicit Course(const string& s) {
  14.         value = s;
  15.     }
  16. };
  17.  
  18. struct Week {
  19.     string value;
  20.     explicit Week(const string& s) {
  21.         value = s;
  22.     }
  23. };
  24.  
  25. struct LectureTitle {
  26.   Specialization specialization;
  27.   Course course;
  28.   Week week;
  29.   LectureTitle(Specialization sp, Course co, Week we) {
  30.       specialization = sp.value;
  31.       course = co.value;
  32.       week = we.value;
  33.   }
  34. };
  35.  
  36. int main(void) {
  37.     LectureTitle title(
  38.         Specialization("C++"),
  39.         Course("White belt"),
  40.         Week("4th")
  41.     );
  42.  
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement