Search found 1 match

by cbminm
Wed Jun 29, 2011 9:33 am
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 65204

488

:oops: Where is the problem of this code?

#include<iostream.h>

int main()
{
int t,a,f;
int i,j,k;
cin>>t;
while(t--)
{
cin>>a>>f;
for(i=f;i>0;i--)
{
for(j=1;j<a;j++)
{
for(k=1;k<j;k++)
cout<<j;
cout<<endl;
}

for(j=a-1;j>0;j--)
{
for(k=j;k>=1;k--)
cout<<j;
cout<<endl;
}
}

if(!t ...

Go to advanced search