Submission #1556027


Source Code Expand

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


int main(){
	int n,a,b;
	cin >> n >> a >> b;
	ans=(b-a)*(n-2)+1;
	cout << (ans<0?0:ans) << endl;
	return 0;
}

Submission Info

Submission Time
Task A - A+...+B Problem
User jack
Language C++14 (GCC 5.4.1)
Score 0
Code Size 166 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:8:2: error: ‘ans’ was not declared in this scope
  ans=(b-a)*(n-2)+1;
  ^