https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=429

题目:每个例子输入2个数,一个是wave的幅度,一个是重复的个数。

例如:
Input
1 3
2 output:
1
22
333
22
1 1
22
333
22
1

思路: 将1,22,333,···,999999999.字符串存在数组里。按照幅度打印输出就好。然后注意一下空行。

 #include<iostream>
#include<cstdio>
using namespace std; char cc[][]={"","","","","","","","",""}; int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
int t,n,m,i,j,k;
cin>>t;
while(t--)
{
cin>>n>>m;
for(i=;i<m;i++)
{
for(j=;j<n;j++)
cout<<cc[j]<<'\n';
for(j=n-;j>=;j--)
cout<<cc[j]<<'\n';
if(i<m-)
cout<<'\n';
}
if(t>)
cout<<'\n'; }
return ;
}

UVa 488 - Triangle Wave的更多相关文章

  1. UVA 488 - Triangle Wave 水~

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  2. uva 11401 Triangle Counting

    // uva 11401 Triangle Counting // // 题目大意: // // 求n范围内,任意选三个不同的数,能组成三角形的个数 // // 解题方法: // // 我们设三角巷的 ...

  3. uva 1478 - Delta Wave(递推+大数+卡特兰数+组合数学)

    option=com_onlinejudge&Itemid=8&category=471&page=show_problem&problem=4224" st ...

  4. UVa 11437:Triangle Fun(计算几何综合应用,求直线交点,向量运算,求三角形面积)

    Problem ATriangle Fun Input: Standard Input Output: Standard Output In the picture below you can see ...

  5. UVA 11401 - Triangle CountingTriangle Counting 数学

    You are given n rods of length 1,2, . . . , n. You have to pick any 3 of them and build a triangle. ...

  6. UVA 11437 - Triangle Fun 向量几何

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  7. 简单几何(求交点) UVA 11437 Triangle Fun

    题目传送门 题意:三角形三等分点连线组成的三角形面积 分析:入门题,先求三等分点,再求交点,最后求面积.还可以用梅涅劳斯定理来做 /********************************** ...

  8. uva 11437 - Triangle Fun

    计算几何: 直线交点: #include<cstdio> using namespace std; struct node { double x,y; node(,):x(x),y(y){ ...

  9. 【递推】【组合计数】UVA - 11401 - Triangle Counting

    http://blog.csdn.net/highacm/article/details/8629173 题目大意:计算从1,2,3,...,n中选出3个不同的整数,使得以它们为边长可以构成三角形的个 ...

随机推荐

  1. win10怎么取消登录密码

    win10安装后每次登录都需要输入密码,挺烦的,查了下,原来windows10无密码登录设置挺方便. 1. 按下win+x组合键,如下图所示 2. 在弹出菜单选择运行,如下图所示 或者直接按win+r ...

  2. 获得、修改 SQL Server表字段说明

    SELECT ( then d.name else '' end) 表名, a.colorder 字段序号, a.name 字段名, g.[value] AS 字段说明 FROM syscolumns ...

  3. PCB设计中的20H原则

    20H原则是指电源层相对地层内缩20H的距离,当然也是为抑制边缘辐射效应.在板的边缘会向外辐射电磁干扰.将电源层内缩,使得电场只在接地层的范围内传导.有效的提高了EMC.若内缩20H则可以将70%的电 ...

  4. form表单的enter自动提交

    当form中只有一个文本框时并且获得焦点 按enter时,就会自动提交表单.阻止自动提交 可以添加一个隐藏的input框 <input type="text" style=& ...

  5. python中的thread

    转载自: http://blog.sina.com.cn/s/blog_9f488855010198vn.html 正确与否未验证 python中得thread的一些机制和C/C++不同:在C/C++ ...

  6. C# char 和string之间转换

    har数组要转换成string可没想象的那么容易.需要使用到System.Text.StringBuilder!实例如下: char[] temp={a,b,c};System.Text.String ...

  7. http://blog.csdn.net/krislight/article/details/9391455

    http://blog.csdn.net/krislight/article/details/9391455

  8. 使用delphi+intraweb进行微信开发5—准备实现微信API,先从获取AccessToken开始

    在前4讲中我们已经使iw开发的应用成功和微信进行了对接,再接下来的章节中我们开始逐一尝试和实现微信的各个API,开始前先来点准备工作 首先需要明确的是,微信的API都是通过https调用实现的,分为p ...

  9. 转:C# 中 MSCHART 饼状图显示百分比

    转自:http://blog.sina.com.cn/s/blog_51beaf0e0100yffo.html 1)显示百分比 Chart1.Series["Series1"].L ...

  10. HEVC学习之二CTU, CU, CTB, CB, PB, TB

    在H264标准中,编码层的核心是宏块,一个宏块大小为16X16,包含一个16X16的亮度块,以及对于常用的4:2:0采样格式来说还包含两个8X8的色度块.相对应的在HEVC中类似的结构为编码树单元(C ...