January 16, 2017
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin>>n;
unsigned long long int a=4294967295,b;
while(n--)
{
cin>>b;
cout<<a-b<<endl;
}
return 0;
}
instead of defining the value of 'a' you could use
ReplyDeletecout<<UINT_MAX-b; //UINT_MAX is the max value of unsigned int and it is defined in limits header file