Page 1 of 1

488-Triangle wave (continuously getting presentation error)

Posted: Wed Jul 13, 2016 10:30 am
by FahimSifnatul
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;
}
:cry:

Re: 488-Triangle wave (continuously getting presentation error)

Posted: Thu Jul 14, 2016 11:02 am
by metaphysis
(1)The outputs of two consecutive cases will be separated by a blank line.
You print a blank line before first test case.
(2) and there is a blank line after each separate waveform, excluding the last one.
Check you output again, you should get AC.