#include "Q1-VerifyUniqueCharInString.h"
#include <cstring>
#include <stdio.h>
#include <string.h>
using namespace std;
bool isUniqueChar(string str)
{
int length=strlen(str),i=0;
bool tab[] = new bool[length];
if (length > 0xff) {
return false;
}
for (; i<length;++i) {
if (str[i]) {
return false;
}
tab[str[i]]=true;
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
这是我的代码,我使用gcc + xcode ....为什么总是告诉我找不到strlen,我同时使用cstring和string.h ...
| 归档时间: |
|
| 查看次数: |
195 次 |
| 最近记录: |