488-Triangle wave (continuously getting presentation error)

All about problems in Volume 4. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
FahimSifnatul
New poster
Posts: 2
Joined: Sat Jun 25, 2016 8:10 am

488-Triangle wave (continuously getting presentation error)

Post 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:
metaphysis
Experienced poster
Posts: 139
Joined: Wed May 18, 2011 3:04 pm

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

Post 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.
Post Reply

Return to “Volume 4 (400-499)”