Uva 488 Triangle Wave

原创 2012年03月29日 16:05:50
#include<stdio.h>
int main()
{
	int t,i,j,k;
	scanf("%d",&t);
	while(t--)
	{
		int amplitude;
		int frequency;
		scanf("%d%d",&litude,&frequency);
		for(i=0; i<frequency; i++)
		{
			for(j=1; j<=amplitude; j++)
			{
				for(k=1; k<=j; k++)
					printf("%d",j);
				printf("\n");
			}
			for(j=amplitude-1; j>=1; j--)
			{
				for(k=1; k<=j; k++)
					printf("%d",j);
				printf("\n");
			}
			if(i!=frequency-1)
				printf("\n");
		}
		if(t!=0)
			printf("\n");
	}
	return 0;
}

相关文章推荐

UVA 488 Triangle Wave(输出三角波)

Triangle Wave Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Sta ...

UVa488 Triangle Wave

Triangle Wave  In this problem you are to generate a triangular wave form according to a sp...

UVa 488 Triangle Wave(三角波)

Triangle Wave  In this problem you are to generate a triangular wave form according to a specifi...

UVa 488 Triangle Wave (water ver.)

488 - Triangle Wave Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_online...

UVA oj 488 Triangle Wave

Triangle Wave Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu...
  • Sara_YF
  • Sara_YF
  • 2016年06月02日 12:51
  • 177

UVA - 488 Triangle Wave(水题)

Triangle Wave  In this problem you are to generate a triangular wave form according to a spec...

488 - Triangle Wave

Triangle Wave  In this problem you are to generate a triangular wave form according to a spec...

Volume 0. Getting Started Uva10055, 10071,10300,458,494,490,414,445,488,489,694,457

刘汝佳 算法入门 第一版

UVa 10746 Crime Wave - The Sequel (最小费用最大流+卡精度)

题意:还记得上次那些抢银行的强盗吗?这次为了银行的安全,要派一些警察去守护这些银行。现在有n个银行和m警察,给出每个警察到达各个银行的时间,问说怎么样安排人手,可以使的警察到达银行的平均时间最小。 ...

UVA 10746 Crime Wave – The Sequel(费用流)

题意: 有m个警察,派n个警察到n个银行,给出每个警察到各银行的时间,求最小的平均时间。 分析: 平均乘上n就是总时间,也就是要最小化总时间,那么用费用流就可以解决问题。各银行向每个警察连边,容量1,...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Uva 488 Triangle Wave
举报原因:
原因补充:

(最多只允许输入30个字)