用vb语言赋值 要求:输入a显示z 输入b显示x 输入c显示c 输入d显示v......就是 5
用vb语言赋值要求:输入a显示z输入b显示x输入c显示c输入d显示v......就是按照键盘顺序赋值...
用vb语言赋值 要求:输入a显示z 输入b显示x 输入c显示c 输入d显示v......就是按照键盘顺序赋值
展开
1个回答
展开全部
Option Explicit On
Option Strict On
Module Program
Sub Main()
Const mingwen As String="abcdefghijklmnopqrstuvwxyz"
Const miwen As String="zxcvbnmasdfghjklqwertyuiop"
Dim str As String
Dim sb As New System.Text.StringBuilder()
Dim n As Integer=-1
Console.WriteLine("请输入一个字符串,将对其加密:")
str=Console.ReadLine()
For i As Integer=0 To str.Length-1
n=mingwen.IndexOf(str(i))
If -1<>n Then
sb.Append(miwen(n))
Else
sb.Append(str(i))
End If
Next
Console.WriteLine("对字符串进行加密后是:")
Console.WriteLine(sb.ToString())
Console.Write("Press any key to continue . . . ")
Console.ReadKey(True)
End Sub
End Module
Option Strict On
Module Program
Sub Main()
Const mingwen As String="abcdefghijklmnopqrstuvwxyz"
Const miwen As String="zxcvbnmasdfghjklqwertyuiop"
Dim str As String
Dim sb As New System.Text.StringBuilder()
Dim n As Integer=-1
Console.WriteLine("请输入一个字符串,将对其加密:")
str=Console.ReadLine()
For i As Integer=0 To str.Length-1
n=mingwen.IndexOf(str(i))
If -1<>n Then
sb.Append(miwen(n))
Else
sb.Append(str(i))
End If
Next
Console.WriteLine("对字符串进行加密后是:")
Console.WriteLine(sb.ToString())
Console.Write("Press any key to continue . . . ")
Console.ReadKey(True)
End Sub
End Module
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询