由买买提看人间百态

topics

全部话题 - 话题: achar
(共0页)
m*******m
发帖数: 82
1
来自主题: JobHunting版 - 贡献一个朋友在Google的面题一枚。
Interview Questions:
Redefine a function (signature given) to write data to a new replacement for
an antiquated database (which you previously designed)
Answer Question:
Write a function to return the longest common prefix between two strings.
//java code
String GetCommonPrefix(String a, String b)
{
char[] aChar = a.toCharArray();
char[] bChar = b.toCharArray();
int startIndex = 0;
//choose short length as the end index
int needLength= aChar.length>bChar.length?bChar.length:aChar.lengt... 阅读全帖
w****o
发帖数: 2260
2
来自主题: JobHunting版 - 贡献一个朋友在Google的面题一枚。
One mistake in the code:
//java code
String GetCommonPrefix(String a, String b)
{
char[] aChar = a.toCharArray();
char[] bChar = b.toCharArray();
int startIndex = 0;
//choose short length as the end index
int needLength= aChar.length>bChar.length?bChar.length:aChar.length;
while(startIndex {
if(aChar[startIndex]!=bChar[startIndex])//find different!
break;
else
startIndex++;
}
return a.subString(0, startIndex);
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>... 阅读全帖

发帖数: 1
3
12月 谈谈间谍问题
我一直感觉Reuters 有日本的间谍,他们会通过报道来传递针对华人屠杀的计划,和发
布不利于华人的报道,制造舆论。最重要他们后边的势力和犯罪集团有关。有必要好好
调查这个组织。
How top U.S. colleges hooked up with controversial Chinese companies
By Steve Stecklow and Alexandra Harney
Filed Dec. 2, 2016, noon GMT
New Oriental, China’s biggest private educator, has been accused of
academic fraud. Thanks to two enterprising Americans, it has also gained
access to leading U.S. college admissions officers.
SHANGHAI/SHELTER ISLAND, New York - Thomas Benson once ran a small... 阅读全帖
j****s
发帖数: 1522
4
来自主题: CS版 - ask a fortran question
How can I convert an integer to a character in fortran?
For example, IY=1984, 1985, ..., and IY is changable, and I wish the character
YEAR would be 1984, 1985, ..., too, and it could be changed following IY. I
try to use the function achar and char, and they don't work as my expectation.
Actually, my final purpose is to concatenate characters (strings) with integer
and create a new string. Please tell me how I can do. Thanks.
p******o
发帖数: 216
5
来自主题: Computation版 - MPI Write?
I just do like this:
call mpi_comm_rank(..., proc_id, ...)
filename = "data"//achar(proc_id + 48)
open(..., file = filename, ...)
...
it works for me. don't know if there's other better way. :)
(共0页)