제출 #1157773

#제출 시각아이디문제언어결과실행 시간메모리
1157773aritro_A + B (IOI24_aplusb)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;

int sum(int A, int B){
  return a+b;
}

int32_t main(){
  int a,b;
  cin>>a>>b;
  cout<<sum(a,b)<<endl;
}

컴파일 시 표준 에러 (stderr) 메시지

aplusb.cpp: In function 'int sum(int, int)':
aplusb.cpp:5:10: error: 'a' was not declared in this scope
    5 |   return a+b;
      |          ^
aplusb.cpp:5:12: error: 'b' was not declared in this scope
    5 |   return a+b;
      |            ^