This week is mainly a brief introduction to the basics of. NET syntax and some job exercises, most of which are related to the C language. At first there are grammatical differences, writing code to have difficulty, logic a little conversion. But through last week's exercise, now write
Homework, or very fast.
This two-week harvest:
1, solve the problem step: A, analyze test instructions First, find out the problem request. b, write the code on the paper probably or draw the approximate flowchart. C. Write the final code on the console
2, find the solution of the problem:
A. Declaring a bool variable;
B. Enter the loop to determine if the search is complete.
C. If you have not finished searching, continue to search. If the search is complete, the final result is output.
Eg: Finding the problem: whether the array can be removed
Int[] nums={3,65,23,22};
Console.WriteLine ("Please enter a number:");
int N=convert.toint32 (Console.ReadLine ());
Console.WriteLine ("The number you entered is: {0}", n);
BOOL can = FALSE;
for (int i = 0; i < Nums. Length; i++)
{
If (Nums[i]% n = = 0) {
can = true;
Break
}
}
if (can==true)
{
Console.WriteLine ("Divisible");
}
else {
Console.WriteLine ("Cannot divide evenly");
}
。 NET Beginner