Home > Software engineering >  VB input 4 number, the number 4
VB input 4 number, the number 4

Time:09-17

In VB arbitrary input number 4, for the four number

CodePudding user response:

CodePudding user response:

For reference only, although not VB6:
 # include & lt; stdio.h> 
#include
#include
Int m;//record the length of the string
int n;//record the number of types of characters in a string
Char map [256].//record is what kind of character
Int count [256];//record each character how many
Int stack [1000];//recursive stack, and record the arrangement of the current generation
Void Make_Map (char * STR) {//statistics the related information of the string
Int s [256];
int i;
Memset (s, 0, sizeof (s));
Memset (count, 0, sizeof (count));
M=strlen (STR);
While (* STR) {
S [* STR] + +;
str++;
}
N=0;
for (i=0; i<256; I++)
If (s) [I] {
The map [n]=I;
The count [n] [I]=s;
n++;
}
}
Void the Find (int the depth) {//recursion backtracking generating permutations
If (the depth==m) {
int i;
for (i=0; iputchar('\n');
} else {
int i;
for (i=0; iIf (count [I]) {
Stack [the depth]=I;
The count [I] -;
Find the depth (+ 1);
The count [I] + +;
}
}
}
Void main (int arg c, char * * argv) {
If (argc<2) {
Printf (" % s to produce the whole arrangement of string \ n ", argv [0]).
return;
}
Make_Map (argv [1]);
Find (0);
}

CodePudding user response:

refer to the second floor zhao4zhong1 response:
are for reference only, although not VB6:
 # include & lt; stdio.h> 
#include
#include
.

Zhao four, you pervert!
The building Lord even have the question, a few sort: are you sure you can understand the code!!!!!!

You are sending VB6 he may not able to read, c + + also...

CodePudding user response:

Void main (int arg c, char * * argv) {
}
Oh, by the way, this style should be C, not C + +,

CodePudding user response:

Sorting algorithm is the most basic entry-level algorithm, suggested the building to search for common sorting algorithms to learn,

CodePudding user response:

Significant work post, it's not a good answer

CodePudding user response:

Bubble had better understand ~

CodePudding user response:

In VB, the most convenient way, is to use attributes Sorted=True Listbox sorting,

1 using List1. Clear such statements to empty ListBox,
Number by 2 to 4 List1. AddItem such statements into a LostBox, (not cycle and array and will write 4 sentences),

The number in the ListBox has automatic sorting, according to the Index sequence can be read,

CodePudding user response:

Upstairs I play

CodePudding user response:

refer to the eighth floor of123 response:
in VB, and the most convenient way, is to use attributes Sorted=True Listbox sorting,

1 using List1. Clear such statements to empty ListBox,
Number by 2 to 4 List1. AddItem such statements into a LostBox, (not cycle and array and will write 4 sentences),

The number in the ListBox has automatic sorting, according to the Index order that can be read


Then simply use vb.net to sortedlist throw

CodePudding user response:

Arrangement and order is the same thing?

CodePudding user response:

Very cow! How make?

CodePudding user response:

The bubbling, basic

CodePudding user response:

The
reference 11 floor zhao4zhong1 response:
arrangement and sequence is the same thing?

Well, really is not the same thing,

At that time, see this post, think of the "sort",
May be "a slip of the pen" of the building Lord also maybe...

If it is to "arrange", then still have to clear is "the whole arrangement", or "choose arrangement; To "order" ever asked...
The conditions of the and so on... But the original poster is P don't put a...

CodePudding user response:

May be the "eye" by mistake also Chen8013 maybe...

CodePudding user response:

Build a database, save to the database, and then select... The order by

There is a way to:
1: use the open filename for the output of the method to establish the empty file name for the four number.
2: use a shell called dir/n command to sort the output by name, or followed & gt;> XXX. TXT to output the results to the text...

Above are "inspired" by the @ of123 imagination. I can only guarantee the feasibility. You ask him to code.

CodePudding user response:

Private Sub Command1_Click ()
Dim a (10) As an Integer
For I=1 To 4
Randomize
A (I)=Int (Rnd * 90) + 10
Next I
For I=1 To 3
For j=I + 1 To 4
If a (I) & gt; A (j) Then
R=a (I)
A (I)=a (j)
A (j)=r
End the If
Next j
Next I
For I=1 To 4
Print a (I);
Next I
End Sub

CodePudding user response:

refer to the second floor zhao4zhong1 response:
are for reference only, although not VB6:
 # include & lt; stdio.h> 
#include
#include
Int m;//record the length of the string
int n;//record the number of types of characters in a string
Char map [256].//record is what kind of character
Int count [256];//record each character how many
Int stack [1000];//recursive stack, and record the arrangement of the current generation
Void Make_Map (char * STR) {//statistics the related information of the string
Int s [256];
int i;
Memset (s, 0, sizeof (s));
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related