### 488-Triangle wave (continuously getting presentation error)

Posted:

**Wed Jul 13, 2016 10:30 am**am i going to mad?? continuously getting presentation error....please help me---

#include<iostream>

using namespace std;

int main()

{

long long int a,f,i,j,t;

cin>>t;

while(t--)

{

cout<<endl;

cin>>a>>f;

while(f--)

{

for(i=1;i<=a;i++)

{

for(j=i;j>=1;j--)

{

cout<<i;

}

cout<<endl;

}

for(i=a-1;i>=1;i--)

{

for(j=i;j>=1;j--)

{

cout<<i;

}

cout<<endl;

}

if(f>0)

cout<<endl;

}

}

return 0;

}

#include<iostream>

using namespace std;

int main()

{

long long int a,f,i,j,t;

cin>>t;

while(t--)

{

cout<<endl;

cin>>a>>f;

while(f--)

{

for(i=1;i<=a;i++)

{

for(j=i;j>=1;j--)

{

cout<<i;

}

cout<<endl;

}

for(i=a-1;i>=1;i--)

{

for(j=i;j>=1;j--)

{

cout<<i;

}

cout<<endl;

}

if(f>0)

cout<<endl;

}

}

return 0;

}