以下代码中的" - 97"是什么意思?
if (dictionary[(int) word.charAt(0) -97 ].contains(word))
Run Code Online (Sandbox Code Playgroud)
我们创建了一个26 LinkedList的数组来模拟字典.每个列表包含以"a","b","c",...开头的所有单词."Z".代码由讲师给出.
以下是附注:
搜索特定MyLinkedList中的单词
假设您要搜索的单词位于名为wordstr的String类型变量中.
Run Code Online (Sandbox Code Playgroud)dictionary [(int)wordstr.charAt(0) - 97].contains(wordstr) ;允许你跳转到正确的链表,并且包含将返回true/false,具体取决于单词是否在列表中.
我只是不明白为什么"-97"
我很新......所以我正在观看一个"操作方法"视频,按照说明操作(创建一个"Visual C#","Store Apps","Blank App".将背景颜色更改为橙色,然后按下Ctrl + f5及以下是错误.
1>Error : DEP0700 : Registration of the app failed.
Windows cannot deploy to path G:\C#_Stuff\Projects\WindowStoreAppOrange\WindowStoreAppOrange\WindowStoreAppOrange\bin\Debug of file system type FAT32.
The path must be located on an NTFS volume. (0x80073
Run Code Online (Sandbox Code Playgroud)
任何有用的想法?
这是我的代码
let rec Interest a b c =
if (c=0) then b else Interest(a ((1.0+a)*b) (c-1));;
Run Code Online (Sandbox Code Playgroud)
错误是:
如果(c = 0)则b其他兴趣(a((1.0 + a)*b)(c-1));;
------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
stdin(2,26):错误FS0001:类型不匹配.期待'a但是给'a - > int - >'a当统一''a'和'' - > int - >'a'时,结果类型将是无限的