Language: C++

//競技プログラミング　テンプレ
//
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)

const int max_v = 300;
const int INF = 1000000;



int main() {
	 long long int n, ans=0;
     int i=0;
	cin >> n;
	vector <long long  int> a();

    while(1){
        a(i)= n - (n /10)*10;
        i++;
        n = n/10;
        if(n==0){break;}
    }

    REP(k,i) ans +=a(i);
    if(n % ans ==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   20 |         vector <long long  int> a();
      |                                  ^~
a.cc:23:10: error: too many arguments to function 'std::vector<long long int> a()'
   23 |         a(i)= n - (n /10)*10;
      |         ~^~~
a.cc:20:33: note: declared here
   20 |         vector <long long  int> a();
      |                                 ^
a.cc:23:27: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'long long int')
   23 |         a(i)= n - (n /10)*10;
      |                           ^~
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:4:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'long long int' to 'const std::vector<long long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'long long int' to 'std::vector<long long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'long long int' to 'std::initializer_list<long long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:29:21: error: too many arguments to function 'std::vector<long long int> a()'
   29 |     REP(k,i) ans +=a(i);
      |                    ~^~~
a.cc:20:33: note: declared here
   20 |         vector <long long  int> a();
      |                                 ^
a.cc:29:18: error: no match for 'operator+=' (operand types are 'long long int' and 'std::vector<long long int>')
   29 |     REP(k,i) ans +=a(i);
      |              ~~~~^~~~~~