long long n; long long k; unsigned int count = 0; cin >> n >> k; for(int i = 1; i <= n; i++) { for(int y = i+1; y <= n; y++) { if(i + y == k) { count = count + 1; } } } cout << count << endl; return 0;
unsigned int
unsigned long long
uint64_t
n
k
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)