uvaoj 488 - Triangle Wave
2011-08-01 15:26
260 查看
#define LOCAL #include<iostream> using namespace std; void print(int n) { int i,j; for(i=1;i<n;i++) { for(j=0;j<i;j++) cout<<i; cout<<endl; } for(i=n;i>=1;i--) { for(j=0;j<i;j++) cout<<i; cout<<endl; } } int main() { #ifdef LOCAL freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif int n,x,y,first=1; cin>>n; while(n--) { if(!first) {cout<<endl;} else first=0; cin.get(); //我以为x,y都是整型cin就会跳过空格,看来我错了。。。 cin>>x>>y; print(x); y--; while(y--) { cout<<endl; print(x); } } return 0; }
相关文章推荐
- UVaOJ 488 - Triangle Wave
- UVaOJ 488 - Triangle Wave
- UVaOJ---488 - Triangle Wave
- UVaOJ 488 Triangle Wave
- uva488 Triangle Wave
- UVa_488 - Triangle Wave
- uva488 Triangle Wave
- UVA 488 - Triangle Wave
- UVa 488 - Triangle Wave
- 488 - Triangle Wave
- UVA - 488 Triangle Wave
- UVA 488 - Triangle Wave
- UVA488 Triangle Wave【打印图案】
- 488 - Triangle Wave
- UVa OJ 488 - Triangle Wave
- UVa 488 Triangle Wave(三角波)
- UVa 488 - Triangle Wave
- UVA488 - Triangle Wave
- UVA oj 488 Triangle Wave
- 488 - Triangle Wave