Language: C++

#include<iostream>
#include<string>
using namespace std;
int main () {
    string s;cin>>s;
    string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
    if (s==k[0]) cout<<"7"<<endl;
if (s==k[1]) cout<<"6"<<endl;
if (s==k[2]) cout<<"5"<<endl;
if (s==k[3]) cout<<"4"<<endl;
if (s==k[4]) cout<<"3"<<endl;
if (s==k[5]) cout<<"2"<<endl;
if (s==k[6]) cout<<"1"<<endl;
}


Compiler output:
a.cc:6:20: warning: multi-character character constant [-Wmultichar]
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                    ^~~~~
a.cc:6:26: warning: multi-character character constant [-Wmultichar]
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                          ^~~~~
a.cc:6:32: warning: multi-character character constant [-Wmultichar]
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                ^~~~~
a.cc:6:38: warning: multi-character character constant [-Wmultichar]
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                      ^~~~~
a.cc:6:44: warning: multi-character character constant [-Wmultichar]
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                            ^~~~~
a.cc:6:50: warning: multi-character character constant [-Wmultichar]
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                                  ^~~~~
a.cc:6:56: warning: multi-character character constant [-Wmultichar]
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                                        ^~~~~
a.cc: In function 'int main()':
a.cc:6:20: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                    ^~~~~
a.cc:6:26: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                          ^~~~~
a.cc:6:32: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                ^~~~~
a.cc:6:38: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                      ^~~~~
a.cc:6:44: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                            ^~~~~
a.cc:6:50: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                                  ^~~~~
a.cc:6:56: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |     string k[7] = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
      |                                                        ^~~~~