제출 #164285

#제출 시각아이디문제언어결과실행 시간메모리
164285daddy0h일차 함수 (tutorial4)C++11
컴파일 에러
0 ms0 KiB
/// https://oj.uz/problem/view/tutorial4 /// f(x) = ax + b; /// -10^2 <= x <= 10^2 /// -10^5 <= a, b <= 10^5 #include <bits/stdc++.h> #include "grader.h" using namespace std; #include "grader.h" void solve() { int x1 = 0; int b = f(x1); int a; int x2 = 1; int a = f(x2) - b; Report(a, b); }

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

tutorial4.cpp: In function 'void solve()':
tutorial4.cpp:19:6: error: redeclaration of 'int a'
  int a = f(x2) - b;
      ^
tutorial4.cpp:17:6: note: 'int a' previously declared here
  int a;
      ^