# can't figure out why its wrong, pls help!

i tried to do this problem : http://www.codechef.com/problems/APGE02

and the thing is in my system m getting its answer but on posting my code here on codechef, it says output does not match like required, i think i have done it ryt but i cant figure out why is it not accepting…

here’s the code :
//dated : 28/11/2013 2228 hours

``````#include<fstream>
#include<iostream>

using namespace std;

int X;

void space(int x)
{
for(int i=1;i<=x;i++)
cout<<" ";
}

void star(int x)
{
for(int i=1;i<=x;i++)
cout<<".";

}

void f_e(int i)
{
if(i==1)
{
space(2*(X-4));
}
else if(i==2)
{
space(X-6); star(1);
space(2);
star(1); space(X-6);
}
else if(i==3)
{
space(X-7); star(6); space(X-7);
}
else
{
star(2*(X-4));
}
}

void run_program()
{
int s=0, v=0;

for(int i=1;i<=X/2;i++)
{
space(s);
star((2*X)-v);
f_e(i);
star((2*X)-v);
cout<<"\n";

s=s+2;; v=v+2;

}

v=0; s=X+(X-4);

for(int i=1;i<=X/2;i++)
{
space(s);
star(2*(X-v));
cout<<"\n";

s=s+2;; v=v+2;
}

cout<<"***\n";

}

int main(int argc, char *argv[])
{

ifstream fin(argv[1]);

int N;

fin>>N;

for(int i=1;i<=N;i++)
{
fin>>X;
run_program();
}

return 0;
}``````

Are you sure that you ARE GETTING AN ANSWER in the local system?
Wen i checked i am not getting any output…

i have taken same inputs in input.txt as given in the example :

let me look macha…

thanks…!!
it works fine with other inputs too, i tried it with odd numbers too, cause i thought may b its not correct for odd numbers as input, but i still dont knw why its wrong!

//