如何在asp.net中打印模式 [英] how to print pattern in asp.net
本文介绍了如何在asp.net中打印模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以打印出类似的图案 -
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
使用for循环...
plz help ...
解决方案
int max = 16;
for(int i = 1; i< 5; i ++)
{
for(int j = 1; j< max; j ++)>
{
//如果您只想在屏幕上打印,可以使用textarea或label然后插入j的值
//喜欢console.write(j);
//或者如果你想生成这种模式的图像你可以去throgh位图类只需绑定//你的数据或者将其附加到位图数组
}
max--;
//console.write(\"\\\
\");
//将这个\ n附加到位图类附加
}
int num = 16 跨度>;
for ( int i = 0 ; i< 6; i ++)
{
for ( int x = 1 ; x< num; x ++)>
{
console。的WriteLine(X);
console.writeLine( );
}
console.writeLine( \ n);
if (i< 4)
{
num--;
}
}
dear sir,
can i print pattern like-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
using for loop...
plz help...
解决方案
int max=16;
for(int i=1;i<5;i++)
{
for(int j=1;j<max;j++)>
{
//if you want just to print on screen you can take textarea or label then insert value of j
//like console.write(j);
//or if you want to generate image of this pattern you can go throgh bitmap class just bind //your data or append it to bitmap array
}
max--;
//console.write("\n");
//append this \n in bitmap class append
}
catch the idea here
int num=16; for(int i=0;i<6;i++) { for(int x=1;x<num;x++)> { console.writeLine(x); console.writeLine(" "); } console.writeLine("\n"); if(i<4) { num--; } }
这篇关于如何在asp.net中打印模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文