-
etc. The number of first elements in each dimension in turn, one dimension = 5 (package.
-
Combinations and permutations are easy to find.
But what the hell is the connection between the two elements of your ab, you don't make it clear what you need.
-
I've written it before, I can't find it, and I'm writing it again. Use recursion to do class arrange
chars = ;
public listgetallarrangements()return returnvalue;
private listgetarrangements(string s, int length);}
listreturnvalue = new list();
for (int i = 0; i < i++)return returnvalue;}} Result of the call:
-
This is the so-called Rubik's Cube matrix or called the magic square, are you writing it wrong, and how can the value be 6, the magic square and value of 4*4 should be 34
The general definition of a plane Rubik's cube is to arrange the natural numbers 1 to n 2 in a square matrix of n rows and n columns, so that the sum of n numbers in each row, column and two main diagonals is equal to n (n 2+1) 2, such a square is called an n-order magic square.
n is a multiple of 4.
The symmetrical element exchange method is adopted.
First, fill in the matrix with the numbers 1 to n n in order from top to bottom, from left to right, and then the numbers on the two diagonals in all 4 and 4 sub-squares of the square matrix are symmetrically exchanged with respect to the center of the large square matrix (note that the numbers on the diagonal of each submatrix are exchanged), that is, a(i,j) and a(n+1-i,n+1-j) are exchanged, and the numbers in all other positions remain unchanged. (Or leave the diagonal unchanged and other positions symmetrically swapped).
-
Hello, there are three levels of nesting.
for(int a = 0; a < 11; a ++for(int b = 10-a; b < a;b++)for(int c = 10-b; c0);
That's the general idea, you can use it after you debug it.
-
There are built-in conversion binary ones. , 2));
For is indeed too much, if it can be changed to recursive. Give you a method, you can call it in the console. The return is a string.
static string tobinary(int32 num)else}
-
This is a classic problem of the allied algorithm, and I wrote the algorithm below, which is the using system of c;
using ;
using ;
namespace pailie
Recursive algorithms. str: the input string tochar result m: the start position of the rearrangement.
The start position of the full arrangement is 0 n: The beginning position of the full arrangement is the string length private static void pai(ref char str, int m, int n).
else shifted.
private static void chang(ref char str, int m)
str[m] = temp;}}
It's not easy to write an algorithm. Let's add a few points.
It's not very hard that the tail node next points to null. >>>More
Reads characters and counts to'\0'Come to an end!
This question is not difficult, and it is easy to understand the pointers. >>>More
main()
Enter a long integer and output a long integer* >>>More
The British constitution stipulates that Britain is a constitutional monarchy, and an important provision of the constitutional monarchy is that parliament has the supreme power, and the legislative power is higher than the executive power. The representatives of the constitutional monarchy are: the only experiment in the history of the United Kingdom to write a constitution, the "Covenant Law". >>>More