Advertisement
Mohammed_AhmedAF

quiz1

Apr 21st, 2024
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <string_view>
  3.  
  4. enum day_of_week{
  5.     sunday = 1,
  6.     monday,
  7.     teusday,
  8.     wednesday,
  9.     thursday,
  10.     friday,
  11.     saturday
  12. } day_of_week;
  13.  
  14. constexpr std::string_view days [] =
  15. {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
  16.  
  17. int main()
  18. {
  19.     enum day_of_week today = sunday;
  20.     std::cout << today << std::endl;
  21.  
  22.     std::cout << days[(today+10)%7] << std::endl;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement