Language: C++

#include<iostream>
using namespace std;
int main(){
  string n;
  cin >> n;
  int ans = 0;
  for(int i = 0; i < n.size(); i++){
    switch(n[i]){
      case "0":
        ans += 0;
        break;
      case "1":
        ans += 1;
        break;
      case "2":
        ans += 2;
        break;
      case "3":
        ans += 3;
        break;
      case "4":
        ans += 4;
        break;
      case "5":
        ans += 5;
        break;
      case "6":
        ans += 6;
        break;
      case "7":
        ans += 7;
        break;
      case "8":
        ans += 8;
        break;
      case "9":
        ans += 9;
        break;
      default:
        break;
    }
  }
  if(ans % 9 == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: conversion from 'const char*' to 'int' in a converted constant expression
    9 |       case "0":
      |            ^~~
a.cc:9:12: error: could not convert '"0"' from 'const char [2]' to 'int'
    9 |       case "0":
      |            ^~~
      |            |
      |            const char [2]
a.cc:12:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   12 |       case "1":
      |            ^~~
a.cc:12:12: error: could not convert '"1"' from 'const char [2]' to 'int'
   12 |       case "1":
      |            ^~~
      |            |
      |            const char [2]
a.cc:15:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   15 |       case "2":
      |            ^~~
a.cc:15:12: error: could not convert '"2"' from 'const char [2]' to 'int'
   15 |       case "2":
      |            ^~~
      |            |
      |            const char [2]
a.cc:18:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   18 |       case "3":
      |            ^~~
a.cc:18:12: error: could not convert '"3"' from 'const char [2]' to 'int'
   18 |       case "3":
      |            ^~~
      |            |
      |            const char [2]
a.cc:21:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   21 |       case "4":
      |            ^~~
a.cc:21:12: error: could not convert '"4"' from 'const char [2]' to 'int'
   21 |       case "4":
      |            ^~~
      |            |
      |            const char [2]
a.cc:24:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   24 |       case "5":
      |            ^~~
a.cc:24:12: error: could not convert '"5"' from 'const char [2]' to 'int'
   24 |       case "5":
      |            ^~~
      |            |
      |            const char [2]
a.cc:27:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   27 |       case "6":
      |            ^~~
a.cc:27:12: error: could not convert '"6"' from 'const char [2]' to 'int'
   27 |       case "6":
      |            ^~~
      |            |
      |            const char [2]
a.cc:30:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   30 |       case "7":
      |            ^~~
a.cc:30:12: error: could not convert '"7"' from 'const char [2]' to 'int'
   30 |       case "7":
      |            ^~~
      |            |
      |            const char [2]
a.cc:33:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   33 |       case "8":
      |            ^~~
a.cc:33:12: error: could not convert '"8"' from 'const char [2]' to 'int'
   33 |       case "8":
      |            ^~~
      |            |
      |            const char [2]
a.cc:36:12: error: conversion from 'const char*' to 'int' in a converted constant expression
   36 |       case "9":
      |            ^~~
a.cc:36:12: error: could not convert '"9"' from 'const char [2]' to 'int'
   36 |       case "9":
      |            ^~~
      |            |
      |            const char [2]