#include
#include<math.h>
using namespace std;
int main()
{
int x,n, y;
cin >> n;
if (n>1 && n<1000)
while (n–){
cin >> x ;
if (x>1 && x<10000)
x=x/2;
y=(0.5xx)-(0.5*x);
cout << y << endl;
}
}
#include
#include<math.h>
using namespace std;
int main()
{
int x,n, y;
cin >> n;
if (n>1 && n<1000)
while (n–){
cin >> x ;
if (x>1 && x<10000)
x=x/2;
y=(0.5xx)-(0.5*x);
cout << y << endl;
}
}
Mate,
The answer is really simple…
Observe the answers and try to find a sequence similar to that…
I won’t reveal the sequence here, so i don’t spoil the fun…
If still unable to solve, Have a look at this code…
Accept answer if you find this helpful…
Feel free to ask anything…