Flow chart to program which count divided by 3 流程图以编程方式计算被3整除的数量

huangapple go评论82阅读模式
英文:

Flow chart to program which count divided by 3

问题

I have reviewed the code and flowchart. The code you provided seems to count the sum of elements in an array and checks if that sum is divisible by 3. However, there is a small issue in your code where the array 'a' is not declared. You should declare it like this:

int[] a;

Other than that, your flowchart appears to represent the logic correctly based on the code you provided. However, I cannot view images, so I can't provide visual feedback on the flowchart. If you have any specific questions or need further assistance, please feel free to ask.

英文:

I have to do flow chart to program which count is number is divided by 3.

I did code like this:

static void Main(string[] args)
{
    int i, n, results;
    Console.WriteLine("Specify number of elements");
    n = int.Parse(Console.ReadLine());
    a = new int[n];

    for (i = 0; i < n; i++)
    {
        Console.WriteLine("Specify number of element a[" + i + "]");
        a[i] = int.Parse(Console.ReadLine());
    }
    results = 0;
    for (i = 0; i < n; i++)
    {
        results += a[i];
    }

    Console.WriteLine("Sum of elements is: " + results);

    if (results % 3 == 0)
    {
        Console.WriteLine("Number is divided by 3");
    }
    else
    {
        Console.WriteLine("Number isn't divided by 3");
    }

    Console.ReadKey();
}

and my flow chart look like in the attached photo:

Flow chart to program which count divided by 3
流程图以编程方式计算被3整除的数量

Could you tell me is it correct?

答案1

得分: 0

Flow diagrams are a bit well, tricky depends how much detail you want but here is what I would do. FYI I would use https://www.draw.io/ for diagrams it's free and pretty good.

英文:

Flow diagrams are a bit well, tricky depends how much detail you want but here is what I would do. FYI I would use https://www.draw.io/ for diagrams it's free and pretty good.

Flow chart to program which count divided by 3
流程图以编程方式计算被3整除的数量

huangapple
  • 本文由 发表于 2020年1月3日 22:54:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/59580704.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定