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");
}
}
}
//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");
}
}
}
相关文章推荐
- UVA 488 Triangle Wave(输出三角波)
- UVa488 - Triangle Wave-难度1
- UVa 488 Triangle Wave(三角波)
- UVA116----简单的DP,但是输出路径比较坑
- UVa 1626 (输出方案) Brackets sequence
- 百度的一道有关随机数按照指定频率输出的题
- 统计一TXT文档中单词出现频率,输出频率最高的10个单词
- UVA 624 —— 01背包&路径输出
- uva11419 SAM I AM(最小顶点覆盖+输出顶点)
- UVa400 按列输出
- 定时器的输出比较模式产生的PWM波的频率计算
- STM32F4_TIM输出PWM波形(可调频率、占空比)
- uva 624 CD (DP + DFS 输出方案)
- STM32一个Timer输出4路不同频率、可调占空比的PWM
- 【DP】UVA 103 Stacking Boxes 输出路径
- uva10054 The Necklace (欧拉回路路径输出 (并查集 + DFS) || (DFS + stack))
- uva488
- 详解STM32的PWM输出及频率和脉宽(占空比)的计算——寄存器配置六步曲!
- UVA531字符串版最长公共子序列,并输出
- Audition CS6在Win 7中“音频输入的采样频率与输出设备不匹配”问题的解决 - imsoft.cnblogs