英文:
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:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论