criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b,x;
  string s;
  cin >> a >> b;
  cin >> s;
  x = 0;
  if(s.size() != a+b+1){
    x++;
  }
  
  if(s.at(a) != '-'){
    x++;
    goto here:
  }
  
  for(int i=0;i<a;i++){
    if(s.at(i) == '-'){
      x++;
    }
  }
  for(int i=a+1;i<b;i++){
    if(s.at(i) == '-'){
      x++;
    }
  }
  here :
  if(x == 0){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: expected ';' before ':' token
   16 |     goto here:
      |              ^
      |              ;
a.cc:16:14: error: expected primary-expression before ':' token
Language: C++

include <bits/stdc++.h>

using namespace std;

int main() {
    int a, b;
    string s;
    cin >> a >> b >> s;

    vector<int> vt;
    for (int i = 0; i < s.length(); ++i) {
        if (s[i] == '-') vt.emplace_back(i);
    }

    if (vt.size() == 1 and vt[0] == a) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string s;
      |     ^~~~~~
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> a >> b >> s;
      |     ^~~
a.cc:8:22: error: 's' was not declared in this scope
    8 |     cin >> a >> b >> s;
      |                      ^
a.cc:10:5: error: 'vector' was not declared in this scope
   10 |     vector<int> vt;
      |     ^~~~~~
a.cc:10:12: error: expected primary-expression before 'int'
   10 |     vector<int> vt;
      |            ^~~
a.cc:12:26: error: 'vt' was not declared in this scope
   12 |         if (s[i] == '-') vt.emplace_back(i);
      |                          ^~
a.cc:15:9: error: 'vt' was not declared in this scope
   15 |     if (vt.size() == 1 and vt[0] == a) {
      |         ^~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:16:26: error: 'endl' was not declared in this scope
   16 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << "No" << endl;
      |         ^~~~
a.cc:18:25: error: 'endl' was not declared in this scope
   18 |         cout << "No" << endl;
      |                         ^~~~
Language: Java

a,b =map(int,input().split())
c =map(int,input().split())
ans=True
if range(c)!=a+b+1 :
    print("No")
else :
    for i in range(a+b+1):
        if i==a and c[i]!="-":
            ans=False
        elif c[i]!=0 and c[i]!=1 and c[i]!=2 and c[i]!=3 and c[i]!=4 and c[i]!=5 and c[i]!=6 and c[i]!=7 and c[i]!=8 and c[i]!=9 :
            ans=False
            
if ans:
    print("Yes")
else:
    print("No")

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
a,b =map(int,input().split())
^
1 error
Language: C

#include<stdio.h>
int main(void){
  int A,B,i=0;
  char N={'\0'};
  scanf("%d %d",&A,&B);
  scanf("%s",N);
  while(N[i]!='\0'){
    if((i!=A && N[i]=='-') || (i==A && N[i]!='-')){
      printf("No\n");
      return 0;
    }
    i++;
  }
  printf("Yes\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:10: error: subscripted value is neither array nor pointer nor vector
    7 |   while(N[i]!='\0'){
      |          ^
main.c:8:18: error: subscripted value is neither array nor pointer nor vector
    8 |     if((i!=A && N[i]=='-') || (i==A && N[i]!='-')){
      |                  ^
main.c:8:41: error: subscripted value is neither array nor pointer nor vector
    8 |     if((i!=A && N[i]=='-') || (i==A && N[i]!='-')){
      |                                         ^
Language: C++

    #include <iostream>
    using namespace std;
    	int  main(){
        	int a,b;
        	string s;
        	cin >> a >> b >> s;
        	if(s[a] == '-' && count(s.begin(), s.end(), '-') == 1){
             	cout << "Yes" << endl;
          	}else{
     	    	cout << "No" << endl;
         	}
       	 	return 0;
      }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:35: error: 'count' was not declared in this scope
    7 |                 if(s[a] == '-' && count(s.begin(), s.end(), '-') == 1){
      |                                   ^~~~~
Language: C++

#include <iostream>
using namespace std;
int  main(){
  int a,b,f=0;
  string s;
  cin >> a >> b >> s;
  if(to_string(a+b+1) == s)
    f=1;
  if(s[a+1] != "-")
    f=1;
  if(s.find("-") != 1)
    f=1;
  
  if(f){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(s[a+1] != "-")
Language: C++

a,b=gets.split.map(&:to_i)
s=gets
if s.match(/\d{#{a}}-\d{#{b}}/)
  puts 'Yes'
else
  puts 'No'
end


Compiler output:
a.cc:3:13: error: stray '\' in program
    3 | if s.match(/\d{#{a}}-\d{#{b}}/)
      |             ^
a.cc:3:16: error: stray '#' in program
    3 | if s.match(/\d{#{a}}-\d{#{b}}/)
      |                ^
a.cc:3:22: error: stray '\' in program
    3 | if s.match(/\d{#{a}}-\d{#{b}}/)
      |                      ^
a.cc:3:25: error: stray '#' in program
    3 | if s.match(/\d{#{a}}-\d{#{b}}/)
      |                         ^
a.cc:4:8: warning: multi-character character constant [-Wmultichar]
    4 |   puts 'Yes'
      |        ^~~~~
a.cc:6:8: warning: multi-character character constant [-Wmultichar]
    6 |   puts 'No'
      |        ^~~~
a.cc:1:1: error: 'a' does not name a type
    1 | a,b=gets.split.map(&:to_i)
      | ^
a.cc:3:21: error: expected unqualified-id before '-' token
    3 | if s.match(/\d{#{a}}-\d{#{b}}/)
      |                     ^
a.cc:3:30: error: expected unqualified-id before '/' token
    3 | if s.match(/\d{#{a}}-\d{#{b}}/)
      |                              ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;


int main(){
    int a, b;
    string s;
    cin>>a>>b>>s;
    int i=1;
    int ans = 0;
    for(auto v:s){
        if(i<=a || (a+2<=i && i<=a+b+1)){
            i++;
            if(v<'0' || v>'9'){
                ans++;
            }
        }
        if(i==a+1){
            i++
            if(v!='-'){
                ans++;
            }
        }
        else{
            ans++;
            break;
        }
    }
    if(ans>0){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: expected ';' before 'if'
   25 |             i++
      |                ^
      |                ;
   26 |             if(v!='-'){
      |             ~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;


int main(){
    int a, b;
    string s;
    cin>>a>>b>>s;
    int i=1;
    int ans = 0;
    for(auto v:s){
        if(i<=a || (a+2<=i && i<=a+b+1){
            i++;
            if(v<'0' || v>'9'){
                ans++;
            }
        }
        if(i==a+1){
            i++
            if(v!='-'){
                ans++;
            }
        }
        else{
            ans++;
            break;
        }
    }
    if(ans>0){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:40: error: expected ')' before '{' token
   18 |         if(i<=a || (a+2<=i && i<=a+b+1){
      |           ~                            ^
      |                                        )
a.cc:34:5: error: expected primary-expression before '}' token
   34 |     }
      |     ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;


int main() {
  int a,b;cin>>a>>b;
  string s;cin>>s;
  for(int i=0;i<a;i++)
  {
    if(s.at(i)/="-")
    {
      if(s.at(a)=="-")
      {
        for(int j=a+1;j<b;j++)
        {
          if(s.at(i)/="-")
          {
            if(s.at(b)/="-")
              cout<<"Yes"<<endl;
            break;
          }
        }
      }
    }
  }
  cout<<"No"<<endl;
}
        
          
 
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char*' to binary 'operator/'
   11 |     if(s.at(i)/="-")
      |        ~~~~~~~^~~~~
a.cc:11:15: note:   in evaluation of 'operator/=(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}, const char*)'
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |       if(s.at(a)=="-")
      |          ~~~~~~~^~~~~
a.cc:17:21: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char*' to binary 'operator/'
   17 |           if(s.at(i)/="-")
      |              ~~~~~~~^~~~~
a.cc:17:21: note:   in evaluation of 'operator/=(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}, const char*)'
a.cc:19:23: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char*' to binary 'operator/'
   19 |             if(s.at(b)/="-")
      |                ~~~~~~~^~~~~
a.cc:19:23: note:   in evaluation of 'operator/=(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}, const char*)'
a.cc: At global scope:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

int main(){
  int a,b,cnt=0;
  string s,c="No";
  cin >> a >> b >> s;
  if(s.at(a)=='-'){
    for(int i=0;i<s.size();i++){
      if(i==a)
        continue;
      else{
      	if(47<s.at(i) && s.at(i)<58)
          cnt++;
      }
    }
  }
  if(cnt==a+b)
    c = "Yes";
  cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string s,c="No";
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> a >> b >> s;
      |   ^~~
a.cc:4:20: error: 's' was not declared in this scope
    4 |   cin >> a >> b >> s;
      |                    ^
a.cc:16:5: error: 'c' was not declared in this scope
   16 |     c = "Yes";
      |     ^
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << c << endl;
      |   ^~~~
a.cc:17:11: error: 'c' was not declared in this scope
   17 |   cout << c << endl;
      |           ^
a.cc:17:16: error: 'endl' was not declared in this scope
   17 |   cout << c << endl;
      |                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B; cin >> A >> B;
  string S; cin >> S;
  
  bool can = true;
  if (int i=0; i<S.size(); i++) {
    if (i==A) { 
      if (S[i]!='-') can = false;
    }
    if (S[i] == '-') can = false;
  }
  if (can) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ')' before ';' token
    9 |   if (int i=0; i<S.size(); i++) {
      |      ~                   ^
      |                          )
a.cc:9:28: error: 'i' was not declared in this scope
    9 |   if (int i=0; i<S.size(); i++) {
      |                            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
template<typename T>inline void read(T &x){
	short f=1;x=0;char c=getchar();
	while(!isdigit(c)){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(isdigit(c)) x=(x<<3)+(x<<1)+(c^48),c=getchar();
	x*=f;
}
int main(){
	int a,b;
	string s;
	read(a),read(b);
	cin>>s;
	if(s[a]!='-')cout<<"No"<<endl,return 0;
	int gs=0;
	for(int i=0;i<=a+b;i++)
		if(!isdigit(s[i]))gs++;
	if(gs>2)cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:39: error: expected primary-expression before 'return'
   17 |         if(s[a]!='-')cout<<"No"<<endl,return 0;
      |                                       ^~~~~~
Language: C++

#include <stdio.h>
int A , B ;
char s [12];
int main ()
{
scanf ("% d % d " ,&A ,& B );
scanf ("% s " ,& s );
for ( int i =0; i < A ; i ++) if (!( 0 <= s [ i ]&& s [ i ] <= 9))
{
puts (" No "); return 0;
}
if ( s [ A ]!= ’-’)
{
puts (" No "); return 0;
}
for ( int i = A +1; i <= A + B ; i ++) if (!( 0  <= s [ i ]&& s [ i ] <= 9 ))
{
puts (" No "); return 0;
}
puts (" Yes ");
}


Compiler output:
a.cc:12:16: error: extended character ’ is not valid in an identifier
   12 | if ( s [ A ]!= ’-’)
      |                ^
a.cc:12:18: error: extended character ’ is not valid in an identifier
   12 | if ( s [ A ]!= ’-’)
      |                  ^
a.cc: In function 'int main()':
a.cc:12:16: error: '\U00002019' was not declared in this scope
   12 | if ( s [ A ]!= ’-’)
      |                ^
Language: C

#include<stdio.h>
int main()
{
  int a, b, i;
  scanf("%d %d", &a, &b);
  char s[a+b+2];
  scanf("%s", s);
  for(i=0;i<a;i++)/*aまで*/{
    if(s[i]=='-'){
      printf("No\n");
      break;
    }else{}
    for(i=a+1;i<a+b+1;i++)/*a+1から*/{
      if(s[i]=='-'){
        printf("No\n");
        break;
      }else{}
    }
  }
  if(s[a]!='-'){
    printf("No\n");
    break;
  }else{}
  printf("Yes\n");
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:22:5: error: break statement not within loop or switch
   22 |     break;
      |     ^~~~~
Language: C++

#include <stdc++.h>
using namespace std;
int main(){
  int a,b;
  string s;
  cin >> a >> b >> s;
  for(int i=0;i < (int)s.size(); ++i){
    if(i == a){
      if(s[i] != '-'){
        cout << "No" << endl;
        return 0;
      }
    }else{
      if(!isdigit(s[i])){
        cout << "No" << endl;
        return 0;
      }
    }    
  }
  cout << "Yes" << endl;
}

Compiler output:
a.cc:1:10: fatal error: stdc++.h: No such file or directory
    1 | #include <stdc++.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>

int main(int argc, char** argv) {
  int a, b;
  std::string str;
  std::cin >> a >> b;
  
  std::cin >> str;
  
  char* str_p = str.c_str();
  
  for (int i=0; i< str.length(); i++) {
    if (i<a && str_p[i] == '-') { std::cout << "No"; return -1; }
    if (i == a+1 && str_p[i] != '-') { std::cout << "No"; return -1;}
    if (i>a+1 && i <a+b+1 str_p[i] == '-') { std::cout << "No"; return -1; }
  }
  std::cout << "Yes" << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:10:26: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
   10 |   char* str_p = str.c_str();
      |                 ~~~~~~~~~^~
      |                          |
      |                          const char*
a.cc:15:26: error: expected ')' before 'str_p'
   15 |     if (i>a+1 && i <a+b+1 str_p[i] == '-') { std::cout << "No"; return -1; }
      |        ~                 ^~~~~~
      |                          )
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin>>a>>b;
    string s;
    cin>>s;
    REP(i,a){
        if(s[i]=='-'){
            cout<<"No"<<endl;
            return 0;
        }
    }
    if(s[a]!='-'){
        cout<<"No"<<endl;
        return 0;
    }
    for(int i=0;i<b;i++){
        if(s[i+a+1]=='-'){
            cout<<"No"<<endl;
            return 0;
        }˜
    }
    cout<<"Yes"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:10: error: '\U000002dc' was not declared in this scope
   45 |         }˜
      |          ^
Language: C++

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        char[] postcode = sc.next().toCharArray();
        for (int i = 0; i < postcode.length; i++) {
            if(i == a && !String.valueOf(postcode[i]).equals("-")) {
                System.out.println("No");
                System.exit(0);
            }
            if(i != a && 0 > Character.getNumericValue(postcode[i]) || Character.getNumericValue(postcode[i]) > 9) {
                System.out.println("No");
                System.exit(0);
            }
        }
        System.out.println("Yes");
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B;
  string S, S1, S2, S3;
  
  cin >> A, B;
  cin >> S;
  
  S1 = left(S, A);
  S2 = mid(S, A + 1, 1);
  S3 = right(S, B);
  if S2 <> "-" then cout << "No" << endl; else {
    if len(S1) <> A then cout << "No" << endl; else {
      if len(S2) <> B then cout << "No" << endl; else cout << "Yes" << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   11 |   S1 = left(S, A);
      |             ^
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1062:18: note: in passing argument 1 of 'std::ios_base& std::left(ios_base&)'
 1062 |   left(ios_base& __base)
      |        ~~~~~~~~~~^~~~~~
a.cc:12:8: error: 'mid' was not declared in this scope
   12 |   S2 = mid(S, A + 1, 1);
      |        ^~~
a.cc:13:14: error: invalid initialization of reference of type 'std::ios_base&' from expression of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   13 |   S3 = right(S, B);
      |              ^
/usr/include/c++/14/bits/ios_base.h:1070:19: note: in passing argument 1 of 'std::ios_base& std::right(ios_base&)'
 1070 |   right(ios_base& __base)
      |         ~~~~~~~~~~^~~~~~
a.cc:14:6: error: expected '(' before 'S2'
   14 |   if S2 <> "-" then cout << "No" << endl; else {
      |      ^~
      |      (
a.cc:14:43: error: 'else' without a previous 'if'
   14 |   if S2 <> "-" then cout << "No" << endl; else {
      |                                           ^~~~
a.cc:15:8: error: expected '(' before 'len'
   15 |     if len(S1) <> A then cout << "No" << endl; else {
      |        ^~~
      |        (
a.cc:15:48: error: 'else' without a previous 'if'
   15 |     if len(S1) <> A then cout << "No" << endl; else {
      |                                                ^~~~
a.cc:16:10: error: expected '(' before 'len'
   16 |       if len(S2) <> B then cout << "No" << endl; else cout << "Yes" << endl;
      |          ^~~
      |          (
a.cc:16:50: error: 'else' without a previous 'if'
   16 |       if len(S2) <> B then cout << "No" << endl; else cout << "Yes" << endl;
      |                                                  ^~~~
Language: C++

#include<string.h>
using namespace std;
int main(){

  int A,B;
  string S;
  int i;
  cin>> A>>B;
  cin>> S;
  i=S.find("-");
  if(((i)==A)&&(S.length()-i-1)==B){
    cout<<"YES"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  //cout<<(i)<<"_"<<(S.length()-i-1)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include<string.h>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>> A>>B;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<string.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:9:9: error: 'S' was not declared in this scope
    9 |   cin>> S;
      |         ^
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout<<"YES"<<endl;
      |     ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:18: error: 'endl' was not declared in this scope
   12 |     cout<<"YES"<<endl;
      |                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<string.h>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<"No"<<endl;
      |     ^~~~
a.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:17: error: 'endl' was not declared in this scope
   14 |     cout<<"No"<<endl;
      |                 ^~~~
a.cc:14:17: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<stdio.h>
int main(void){
    int A,B,S;
    int i;
    char str1[],str2[];
    scanf("%d",&str1);
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&S);
    for(i=0; str1[i]!='￥0'; i++);
    if((A==str1[i])&&(str1[i]=="-")){
        printf("Yes");
    }else{
        printf("No");
    }
}

Compiler output:
a.cc:10:23: warning: multi-character character constant [-Wmultichar]
   10 |     for(i=0; str1[i]!='￥0'; i++);
      |                       ^~~~~
a.cc: In function 'int main()':
a.cc:5:10: error: storage size of 'str1' isn't known
    5 |     char str1[],str2[];
      |          ^~~~
a.cc:5:17: error: storage size of 'str2' isn't known
    5 |     char str1[],str2[];
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  // ここにプログラムを追記
  int a;
  int b;
  int c;
  int flag;
  int i;
  int p;
  cin>>a>>b;
  c=a+b+2;
  string str;
  for(i=0;i<c;i++){
  cin>>str[i];
  }
  for(p=0;p<c;p++){
    if(p==a){
      if(str[p]=='-'){flag=1;}
    }else{
      unless((str[p]=='0')||(str[p]=='1')||(str[p]=='2')||(str[p]=='3')||(str[p]=='4')||(str[p]=='5')||(str[p]=='6')||(str[p]=='7')||(str[p]=='8')||(str[p]=='9')){
      flag=1;
      }
    }
  }
  if(flag==0){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'unless' was not declared in this scope
   22 |       unless((str[p]=='0')||(str[p]=='1')||(str[p]=='2')||(str[p]=='3')||(str[p]=='4')||(str[p]=='5')||(str[p]=='6')||(str[p]=='7')||(str[p]=='8')||(str[p]=='9')){
      |       ^~~~~~
Language: C++

#include<iostream>
using namespace std;
long long int a,b,s;
int main()
{
    string s;
    cin>>a>>b;
    cin>>s;
    if(s[a]!='-')
        cout<<"No"<<endl;
        return 0;
    s[a]='1';
    for(int i=0;i<=a+b;i++)
        if(s[i]<'0'||s[i]>'9')
            cout<<"No"<<endl;
            return 0;
    cout<<"Yes"<<endl;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: expected '}' at end of input
   18 |     return 0;
      |              ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <bits/stdc++.h
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    for(int i = 0; i < a; i++)
    {
        if(s[i] < '0' || s[i] > '9')
        {
            cout << "No" << endl;
            return 0;
        }
    }
    if(s[a] != '-')
    {
        cout << "No" << endl;
        return 0;
    }
    for(int i = a+1; i < a+1+b; i++)
    {
        if(s[i] < '0' || s[i] > '9')
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  int a, b;
  cin >> n >> b;
  string s;
  cin >> s;
  if (s[a] != '-') {
    cout << "No\n";
    return 0;
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '-' && i != a) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
    7 |   cin >> n >> b;
      |          ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	int a,b;
	string s;

	cin >> a >> b >> s;
	bool check = true;
	for(int i = 0; i < a+b+1){
		if(i == a){
			if(s[a] != '-')
				check = false;
		}else
			if(s[i] == '-')
				check = false;

	}

	if(check)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: expected ';' before ')' token
   18 |         for(int i = 0; i < a+b+1){
      |                                 ^
      |                                 ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
	int a,b;
	string s;
	cin >> a >> b;
	cin >> s;
	bool b = true;
	for (int i = 0; i < (int)s.size(); ++i)
	{
		if(i < a){
			if((int)(s[i] - '0') > 9 && (int)(s[i] - '0') < 0){
				b = false;
			}
		}else if(i == a){
			if(s[a] != '-')b = false;
		}else{
			if((int)(s[i] - '0') > 9 && (int)(s[i] - '0') < 0){
				b = false;
			}
		}
	}
	if(b){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: conflicting declaration 'bool b'
    8 |         bool b = true;
      |              ^
a.cc:4:15: note: previous declaration as 'int b'
    4 |         int a,b;
      |               ^
Language: C++

#include <iostream>
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#include <set>
#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;

void solve(){

}
int main(){
    int A,B;
    string s;
    cin >> A >> B >> S;

    A--;
    bool ok = true;
    for (int i = 0;  i < (int)s.size(); ++i) {
        if (i <= A) {
            if ((int)s[i] < 0 && (int)s[i] > 9) {
                ok = false;
            }
        } else if (i == A+1) {
            if (s[i] != '-') {
                ok = false;
            }
        } else {
            if ((int)s[i] < 0 && (int)s[i] > 9) {
                ok = false;
            }
        }
    }
    if (ok) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:22: error: 'S' was not declared in this scope
   29 |     cin >> A >> B >> S;
      |                      ^
Language: C++

A, B = map(int, input().split())
S = input().rstrip()
if len(S) == A + B + 1 and S[A] == '-':
    for s in (S[:A]+S[A+1:]):
        if s in list(map(str, range(0, 10))):
            continue
        else:
            print('No')
            exit(0)
    print('Yes')
    exit(0)
print('No')
exit(0)

Compiler output:
a.cc:8:19: warning: multi-character character constant [-Wmultichar]
    8 |             print('No')
      |                   ^~~~
a.cc:10:11: warning: multi-character character constant [-Wmultichar]
   10 |     print('Yes')
      |           ^~~~~
a.cc:12:7: warning: multi-character character constant [-Wmultichar]
   12 | print('No')
      |       ^~~~
a.cc:1:1: error: 'A' does not name a type
    1 | A, B = map(int, input().split())
      | ^
Language: C++

#include"bits/stdc++.h"

using namespace std;

int main() {
	int A, B;
	cin >> A >> B;
	char s[100];
	cin >> s;
	string ans = "Yes";
	for (int i = 0; i < A; i++) {
		if (!('0' <= s[i] && s[i] <= '9')) {
			ans = "No";
		}
	}
	if (s[A] != '-'){
		ans = "No";
	}

	for (int i = A + 1; i <= A + B; i++) {
		if (!('0' <= s[i] && s[i] <= '9')) {
			ans = "No";
		}
	}

	cout << ans << endl;
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: expected '}' at end of input
   27 |         return 0;
      |                  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    String s = sc.next();
    boolean result = true;
    
    if (s.length()!=A+B+1) result = false;
    else if (s.charAt(A) != '-') result = false;
    else {
      String part1 = s.subString(0, A);
      String part2 = s.subString(A+1);
      if (!checkValid(part1) || !checkValid(part2)) result = false;
    }
	
    if (result) System.out.println("Yes");
	else System.out.println("No");
  }
  
  private boolean checkValid(String s) {
    for (int i=0; i<s.length(); i++) {
      char c = s.charAt(i);
      if (c < '0' || c > '9') {
        return false;
      }
    }
    return true;
  }
}

Compiler output:
Main.java:14: error: cannot find symbol
      String part1 = s.subString(0, A);
                      ^
  symbol:   method subString(int,int)
  location: variable s of type String
Main.java:15: error: cannot find symbol
      String part2 = s.subString(A+1);
                      ^
  symbol:   method subString(int)
  location: variable s of type String
Main.java:16: error: non-static method checkValid(String) cannot be referenced from a static context
      if (!checkValid(part1) || !checkValid(part2)) result = false;
           ^
Main.java:16: error: non-static method checkValid(String) cannot be referenced from a static context
      if (!checkValid(part1) || !checkValid(part2)) result = false;
                                 ^
4 errors
Language: C++

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        String s = scan.next();
        if(s.charAt(a)!='-')
        {
            System.out.println("No");
            return;
        }
        for(int i=0;i<a;i++)
        {
            if(s.charAt(i)=='-')
            {
                System.out.println("No");
                return;
            }
        }
        for(int j=a+1;j<=b;j++)
        {
            if(s.charAt(j)=='-')
            {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }    
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
#include <set>
#include <map>
#include <tuple>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,N) for (int i=0;i<N;i++)
#define loop(i,N,M) for(int i=N;i<M;i++)
#define MAX(v) *max_element(v.begin(),v.end())
#define MIN(v) *min_element(v.begin(),v.end())
#define SORTL2S(type,v) sort(v.begin(),v.end(),greater<type>())
#define SORTS2L(type,v) sort(v.begin(),v.end())
#define SORTMF(v,func) sort(v.begin(),v.end(),func)

//変数
ll A,B;
string S;
vector<ll> vec;


//解法
void solve() {
  
  bool flag = true;
  
  rep(i,A) {
    if (S[i]<'0' || S[i]>'9') flag=false;
  }
  if (S[A]!='-') flaag = false;
  rep(i,B) {
    if (S[A+1+i]<'0' || S[A+1+i]>'9') flag = false;
  }
  
  cout << (flag ? "Yes" : "No");
  
	return;
}

int main() {
	//入力

	cin >> A>>B>>S;

	solve();
	cout << endl;
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:40:18: error: 'flaag' was not declared in this scope; did you mean 'flag'?
   40 |   if (S[A]!='-') flaag = false;
      |                  ^~~~~
      |                  flag
Language: C

#include <stdio.h>

int main(void){
    char post[11];
    scanf ("%d %d",&a,&b);
    scanf ("%s",post);
    int i;
    for(i = 0;i<a;i++){
        if(!(post[i] <= '0' && post[i] <= '9')){
            printf("No\n");
            return 0;
        }
        if(post[a]!= '-'){
            printf("No\n");
            return 0;
        }

    }

    for(i = a+1;i<a+b;i++){
        if(!(post[i] <= '0' && post[i] <= '9')){
            printf("No\n");
            return 0;
        }
    }
    printf("Yes\n");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:21: error: 'a' undeclared (first use in this function)
    5 |     scanf ("%d %d",&a,&b);
      |                     ^
main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:24: error: 'b' undeclared (first use in this function)
    5 |     scanf ("%d %d",&a,&b);
      |                        ^
Language: C

#include <stdio.h>

int main(void){
    char post[11];
    scanf ("%d %d",&a,&b);
    scanf ("%s",post);
    int i;
    for(i = 0;i<a;i++){
        if(!(post[i] <= '0' && post[i] <= '9')){
            printf("No\n");
            return;
        }
        if(post[a]!= '-'){
            printf("No\n");
            return;
        }

    }

    for(i = a+1;i<a+b;i++){
        if(!(post[i] <= '0' && post[i] <= '9')){
            printf("No\n");
            return;
        }
    }
    printf("Yes\n");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:21: error: 'a' undeclared (first use in this function)
    5 |     scanf ("%d %d",&a,&b);
      |                     ^
main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:24: error: 'b' undeclared (first use in this function)
    5 |     scanf ("%d %d",&a,&b);
      |                        ^
main.c:11:13: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   11 |             return;
      |             ^~~~~~
main.c:3:5: note: declared here
    3 | int main(void){
      |     ^~~~
main.c:15:13: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   15 |             return;
      |             ^~~~~~
main.c:3:5: note: declared here
    3 | int main(void){
      |     ^~~~
main.c:23:13: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   23 |             return;
      |             ^~~~~~
main.c:3:5: note: declared here
    3 | int main(void){
      |     ^~~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    static void solve(Scanner sc) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        String[] s = sc.next().split("-");
        if (s.length == 2 && [0].length() == a && s[1].length() == b) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Compiler output:
Main.java:15: error: illegal start of expression
        if (s.length == 2 && [0].length() == a && s[1].length() == b) {
                             ^
Main.java:15: error: not a statement
        if (s.length == 2 && [0].length() == a && s[1].length() == b) {
                                               ^
Main.java:15: error: ';' expected
        if (s.length == 2 && [0].length() == a && s[1].length() == b) {
                                                                    ^
Main.java:17: error: 'else' without 'if'
        } else {
          ^
4 errors
Language: C++

// #include<iostream>
// using namespace std;
//
// int main(){
//   int a,b;cin>>a>>b;
//   string n;cin>>n;
//   int m=0;
//   for(int i=0;i<a+b;i++){
//     if(n[i]=='-')m++;
//   }
//   if(n[a]!='-'||n[b+1]!=' '||m>1)cout<<"No"<<endl;
//   else cout<<"Yes"<<endl;
// }
#include<iostream>
using namespace std;

int main(){
  int a,b;cin>>a>>b;
  string s;cin>>s;
  for(int i=0;i<a;i++)if(!('0'<=s[i]&&s[i]<='9')){
    cout<<"No"<<endl;
  }
  if(s[k]!='-'){
    cout<<"No"<<endl;
  }
  for(int i=k+1;i<=a+b;i++)if('0'<=s[i]&&s[i]<='9')){
    cout<<"No"<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: 'k' was not declared in this scope
   23 |   if(s[k]!='-'){
      |        ^
a.cc:26:13: error: 'k' was not declared in this scope
   26 |   for(int i=k+1;i<=a+b;i++)if('0'<=s[i]&&s[i]<='9')){
      |             ^
a.cc:26:52: error: expected primary-expression before ')' token
   26 |   for(int i=k+1;i<=a+b;i++)if('0'<=s[i]&&s[i]<='9')){
      |                                                    ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a,b;cin>>a>>b;
  string n;cin>>n;
  int m=0;
  for(int i=0;i<a+b,i++){
    if(n[i]=='-')m++;
  }
  if(n[a]!='-'||n[b+1]!=' '||m>1)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before ')' token
    8 |   for(int i=0;i<a+b,i++){
      |                        ^
      |                        ;
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a,b;cin>>a>>b;
  string n;cin>>n;
  if(n[a]!='-'||s[b+1]!=' ')cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 's' was not declared in this scope
    7 |   if(n[a]!='-'||s[b+1]!=' ')cout<<"No"<<endl;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b;
  	cin >> a >> b;
  	string s;
  	cin >> s;
  	string _s = s.substr(0,a)+s.substr(a+1,b);
  	if(s[a]=='-') {
      	if(iswdigit(_s)) {
        	cout << "yes" << endl;
          	return 0;
        }
    }
  	cout << "no" << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'wint_t' {aka 'unsigned int'}
   11 |         if(iswdigit(_s)) {
      |                     ^~
      |                     |
      |                     std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/wctype.h:38,
                 from /usr/include/c++/14/cwctype:50,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:124,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/wctype-wchar.h:108:29: note:   initializing argument 1 of 'int iswdigit(wint_t)'
  108 | extern int iswdigit (wint_t __wc) __THROW;
      |                      ~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b;
  	cin >> a >> b;
  	string s;
  	cin >> s;
  	string _s = s.substr(0,a)+s.substr(a+1,b);
  	if(!strcmp(s[a],'-')) {
      	if(iswdigit(_s)) {
        	cout << "yes" << endl;
          	return 0;
        }
    }
  	cout << "no" << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   10 |         if(!strcmp(s[a],'-')) {
      |             ~~~~~~^~~~~~~~~~
      |                   |
      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:10:25: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   10 |         if(!strcmp(s[a],'-')) {
      |                         ^~~
      |                         |
      |                         char
/usr/include/string.h:156:50: note:   initializing argument 2 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
a.cc:11:21: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'wint_t' {aka 'unsigned int'}
   11 |         if(iswdigit(_s)) {
      |                     ^~
      |                     |
      |                     std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/wctype.h:38,
                 from /usr/include/c++/14/cwctype:50,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:124:
/usr/include/x86_64-linux-gnu/bits/wctype-wchar.h:108:29: note:   initializing argument 1 of 'int iswdigit(wint_t)'
  108 | extern int iswdigit (wint_t __wc) __THROW;
      |                      ~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b;
  	cin >> a >> b;
  	string s;
  	cin >> s;
  	string sa = s.substr(0,a);
  	string sb = s.substr(a+1,b);
  	if(!strcmp(s[a],'-')) {
      	for(int i=0; i<a; i++) {
        	if (!isdigit( sa[ i ] )) {
            	cout << "no" << endl;
              	return 0;
            }
        }
      	for(int i=0; i<b; i++) {
        	if (!isdigit( sb[ i ] )) {
            	cout << "no" << endl;
              	return 0;
            }
        }
      	cout << "yes" << endl;
    } else { 
    	cout << "no" << endl;
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   11 |         if(!strcmp(s[a],'-')) {
      |             ~~~~~~^~~~~~~~~~
      |                   |
      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:11:25: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   11 |         if(!strcmp(s[a],'-')) {
      |                         ^~~
      |                         |
      |                         char
/usr/include/string.h:156:50: note:   initializing argument 2 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b;
  	cin >> a >> b;
  	string s;
  	cin >> s;
  	string sa = s.substr(0,a);
  	string sb = s.substr(a+1,b);
  	if(!strcmp(s[a],"-")) {
      	for(int i=0; i<a; i++) {
        	if (!isdigit( sa[ i ] )) {
            	cout << "no" << endl;
              	return 0;
            }
        }
      	for(int i=0; i<b; i++) {
        	if (!isdigit( sb[ i ] )) {
            	cout << "no" << endl;
              	return 0;
            }
        }
      	cout << "yes" << endl;
    } else { 
    	cout << "no" << endl;
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   11 |         if(!strcmp(s[a],"-")) {
      |             ~~~~~~^~~~~~~~~~
      |                   |
      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b;
  	cin >> a >> b;
  	string s;
  	cin >> s;
  	string sa = s.substr(0,a);
  	string sb = s.substr(a+1,b);
  	if(!strcmp(s[a],"-")) {
      	for(int i=0; i<a; i++) {
        	if (!isdigit( sa[ n ] )) {
            	cout << "no" << endl;
              	return 0;
            }
        }
      	for(int i=0; i<b; i++) {
        	if (!isdigit( sb[ n ] )) {
            	cout << "no" << endl;
              	return 0;
            }
        }
      	cout << "yes" << endl;
    } else { 
    	cout << "no" << endl;
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   11 |         if(!strcmp(s[a],"-")) {
      |             ~~~~~~^~~~~~~~~~
      |                   |
      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:13:35: error: 'n' was not declared in this scope
   13 |                 if (!isdigit( sa[ n ] )) {
      |                                   ^
a.cc:19:35: error: 'n' was not declared in this scope
   19 |                 if (!isdigit( sb[ n ] )) {
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
	int a,b;
  	cin >> a >> b;
  	string s;
  	cin >> s;
  	string s1 = s.substr(0,a);
  	string s2 = s.substr(a+1,b);
  	if(s[a] == "-") {
      	for(int i=0; i<a; i++) {
        	if (!isdigit( sa[ n ] )) {
            	cout << "no" << endl;
              	return;
            }
        }
      	for(int i=0; i<b; i++) {
        	if (!isdigit( sb[ n ] )) {
            	cout << "no" << endl;
              	return;
            }
        }
      	cout << "yes" << endl;
    } else { 
    	cout << "no" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(s[a] == "-") {
a.cc:13:31: error: 'sa' was not declared in this scope; did you mean 's2'?
   13 |                 if (!isdigit( sa[ n ] )) {
      |                               ^~
      |                               s2
a.cc:13:35: error: 'n' was not declared in this scope
   13 |                 if (!isdigit( sa[ n ] )) {
      |                                   ^
a.cc:15:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |                 return;
      |                 ^~~~~~
a.cc:19:31: error: 'sb' was not declared in this scope; did you mean 's2'?
   19 |                 if (!isdigit( sb[ n ] )) {
      |                               ^~
      |                               s2
a.cc:19:35: error: 'n' was not declared in this scope
   19 |                 if (!isdigit( sb[ n ] )) {
      |                                   ^
a.cc:21:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   21 |                 return;
      |                 ^~~~~~