Home > Net >  c#
c#

Time:09-22

With the c # 32 problem, who can help me out with c # language, urgent need

CodePudding user response:

 
Console. WriteLine (" please input a string of letters: ");
String a=Console. ReadLine ();

Byte [] x=Encoding. The ASCII. GetBytes (a);
Int [] temp=new int [x.L ength];
For (int I=x.L ength - 1; I & gt;=0; I -)
{

If (I - 1 & gt; 0)
{
Int v=the Convert. ToInt32 (x [I]) & gt;> 4.
Temp. [I]=v + Convert ToInt32 (x] [I - 1);
}

If (I - 1==0)
{
\ [I]=the Convert. ToInt32 [I] (x) + the Convert. ToInt32 (x [x.L] ength - 1);
}
If (I==0)
{
\ [I]=the Convert. ToInt32 [I] (x) + the Convert. ToInt32 (x [I]);
}
}
String b=null;
Byte [] y=new byte/temp. Length;
for (int i=0; i {
[I] y=the Convert. ToByte (temp [I]);
B=Encoding. The ASCII. Get string (y);
}
If (temp. Length==1)
{
Y [0]=the Convert. ToByte (temp [0]).
B=Encoding. The ASCII. Get string (y);
}

String [] overNum=new string [] {a, b};
The foreach (var item in overNum)
{
Console. WriteLine (item);
}

The Console. ReadKey ();

Of new entanglements for a long time to write, I also don't know what to write right, have place hope leaders help me correct the problem

CodePudding user response:

reference 1st floor jkfljask response:
 
Console. WriteLine (" please input a string of letters: ");
String a=Console. ReadLine ();

Byte [] x=Encoding. The ASCII. GetBytes (a);
Int [] temp=new int [x.L ength];
For (int I=x.L ength - 1; I & gt;=0; I -)
{

If (I - 1 & gt; 0)
{
Int v=the Convert. ToInt32 (x [I]) & gt;> 4.
Temp. [I]=v + Convert ToInt32 (x] [I - 1);
}

If (I - 1==0)
{
\ [I]=the Convert. ToInt32 [I] (x) + the Convert. ToInt32 (x [x.L] ength - 1);
}
If (I==0)
{
\ [I]=the Convert. ToInt32 [I] (x) + the Convert. ToInt32 (x [I]);
}
}
String b=null;
Byte [] y=new byte/temp. Length;
for (int i=0; i {
[I] y=the Convert. ToByte (temp [I]);
B=Encoding. The ASCII. Get string (y);
}
If (temp. Length==1)
{
Y [0]=the Convert. ToByte (temp [0]).
B=Encoding. The ASCII. Get string (y);
}

String [] overNum=new string [] {a, b};
The foreach (var item in overNum)
{
Console. WriteLine (item);
}

The Console. ReadKey ();

Of new entanglements for a long time to write, I also don't know what to write right, there is a problem of local hope leaders help me correct the

Do you feel there is something wrong with their thinking, what he said is arbitrary input string, such as: "ab", that this situation is how to make b can move four? Should be taking out b, his move, g code? I think that is the case, such as mobile value becomes the ar after this the mean?

CodePudding user response:

refer to the second floor rabbit family - second brother reply:
Quote: refer to 1st floor jkfljask response:

 
Console. WriteLine (" please input a string of letters: ");
String a=Console. ReadLine ();

Byte [] x=Encoding. The ASCII. GetBytes (a);
Int [] temp=new int [x.L ength];
For (int I=x.L ength - 1; I & gt;=0; I -)
{

If (I - 1 & gt; 0)
{
Int v=the Convert. ToInt32 (x [I]) & gt;> 4.
Temp. [I]=v + Convert ToInt32 (x] [I - 1);
}

If (I - 1==0)
{
\ [I]=the Convert. ToInt32 [I] (x) + the Convert. ToInt32 (x [x.L] ength - 1);
}
If (I==0)
{
\ [I]=the Convert. ToInt32 [I] (x) + the Convert. ToInt32 (x [I]);
}
}
String b=null;
Byte [] y=new byte/temp. Length;
for (int i=0; i {
[I] y=the Convert. ToByte (temp [I]);
B=Encoding. The ASCII. Get string (y);
}
If (temp. Length==1)
{
Y [0]=the Convert. ToByte (temp [0]).
B=Encoding. The ASCII. Get string (y);
}

String [] overNum=new string [] {a, b};
The foreach (var item in overNum)
{
Console. WriteLine (item);
}

The Console. ReadKey ();

Of new entanglements for a long time to write, I also don't know what to write right, there is a problem of local hope leaders help me correct the

Do you feel there is something wrong with their thinking, what he said is arbitrary input string, such as: "ab", that this situation is how to make b can move four? Should be taking out b, his move, g code? I think that is the case, such as mobile value becomes the ar after this the mean?
thank you, I didn't consider the position of too little
  •  Tags:  
  • C#