您的位置:首页 > 其它

UVA488,振幅频率输出数

2011-10-24 18:50 302 查看
//本题的大意是给出振幅A和频率F..输出类似这样的形式.

//1

//22

//333

//22

//1

//这里3为振幅..F为多少就输出多少个这样的东西.

#include<stdio.h>

#include<stdlib.h>

#include<math.h>

#include<iostream>

#include<string.h>

#include<vector>

const int inf = 0x3f3f3f;

using namespace std;

int main()

{

int test,a,f;

while(scanf("%d",&test) != EOF)

{

while(test--)

{

scanf("%d%d",&a,&f);

for(int k = 1 ; k <= f ; k++)

{

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

{

for(int j = 1 ; j <= a - abs(i) ; j++)

{

printf("%d",a - abs(i) );

}

printf("\n");

}

if(f-k)

printf("\n");

}

if(test)printf("\n");

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: