解决这个问题 [英] slove this problem plz

查看:66
本文介绍了解决这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何打印此
1
2 3
4 5 6
7 8 9 10

解决方案

尊重站点及其含义,请勿滥用论坛.

允许您轻描淡写,自己做功课.


如果您想得到一个严肃的答案,请提出一个严肃的问题.

1.)阅读指南

2.)遵循它们,即使用适当的主题行
不是"Gimme Codz pleaz"或"Solve Pls"
这里的大多数成员都是志愿者.他们会猛烈抨击您执行其他操作,因为它会筛选出有用的问题tedius,并开始不希望提供帮助(即使是那些遵守规则的人)

3.)您的同意书必须包含的内容不只此问题.请附上您尝试过的内容.成员们将很乐意为您提供帮助.您可能会犯一些其他成员在学习编程时所犯的相同错误.

4.)不要撒谎.显然,这可能是一个家庭作业问题,也可能是一个面试问题(在我看来属于同一类).这些类型的问题对于您自己解决"至关重要.如果我们给您答案,那么有一天我们可能会与您合作,并且不得不再次握住您的手(在我看来,这是不可接受的).记住一句古老的谚语:给一个人一条鱼,给他喂一天,给一个人一条鱼,给他喂一辈子".简单地为您提供一个直接的答案,我们就不会对您或社区有所帮助.


摘要:
试试吧发表您尝试过的内容,以及有关它的一些详细信息.就像为什么您这样尝试过.不能按您期望的方式工作等等.如果执行此操作,您会发现这是一个非常有用的社区.

 字符串 buildSeries()
{
    //  val是内容,row和col是位置.
    // 分离似乎是关键.
    // 可以构建int数组并作为单独的步骤进行输出. 
    字符串 series = 字符串 .Empty;
     int  val =  1 ;
     for ( int  row =  1 ; row< ; =  4 ; row ++)
    {
         for ( int  col =  1 ; col< ; = row; col ++)
        {
            系列+ = Convert.ToString(val)+ " ;
            val ++;
        }

        系列+ = " ;
    }
    
    返回系列;
} 


how i print this
1
2 3
4 5 6
7 8 9 10

解决方案

Respect the site and what it stands for, do not abuse the forum.

You are allowed one indiscretion, do your own homework.


If you want a serious answer provide a serious question.

1.) Read Guidlines

2.) Follow them, i.e. Use Appropriate Subject lines
Not "Gimme Codz pleaz" or "Solve Pls"
Most members here are volunteers. They will slam you for doing otherwise as it makes sifting through usefull questions tedius and begin to not want to assist (even those that respect the rules)

3.) Your conent must include more than the problem. Please include what you have tried. Members will gladly assist you then. It is likely you are making some of the same mistakes other members made when they were learning how to program.

4.) Don''t lie. This is clearly either a homework problem or possibly an interview question (same category in my mind). These types of problems are critical for you to ''solve'' on your own. If we give you the answer, we could one day be working with you and have to hold your hand again (unacceptable in my mind). Remember the old saying "Give a man a fish, feed him for a day, Teach a man to fish feed him for life". We would not be helping you or the community by simply providing you a straight answer to this.


Summary:
Try something. Post what you have tried, and maybe some details around it. Like why you tried it this way. What is not working the way you expect it etc. If you do this you will find that this is a very helpful community.


private string buildSeries()
{
    // val is the content, row and col are the location.
    // this separation seems to be the key.
    // could build int array and do output as separate step. 
    string series = string.Empty; 
    int val = 1;
    for (int row=1;row<=4;row++)
    {
        for (int col=1;col<=row;col++)
        {
            series += Convert.ToString(val) + " ";
            val++;
        }

        series += "\r\n";       
    }
    
    return series;
}


这篇关于解决这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆