#include <iostream>
using namespace std;
/*
这个是不是唯一串 ;
*/
int func(char * a)
{
int checker = 0;
for(int i = 0;i < strlen(a); ++i)
{
int z = a[i]-'a';
if((checker & (1<<z)) > 0) // if > 0 then there is some bit has elements ;0011000110101 & 0000000000001 = 0000000000001 > 0 这个样子的话 就证明 a重复了·
{
cout << "this is not the unique"<<endl;
break;
}
else
{
checker =checker |(1<<z);//0011 | 0100 =0111;
}
}
cout<<"unique"<<endl;
}
int main()
{
char a[] = "abcj";
int aio = 0;
//cout << "asdfasdf"<<endl;
system("pause");
}
using namespace std;
/*
这个是不是唯一串 ;
*/
int func(char * a)
{
int checker = 0;
for(int i = 0;i < strlen(a); ++i)
{
int z = a[i]-'a';
if((checker & (1<<z)) > 0) // if > 0 then there is some bit has elements ;0011000110101 & 0000000000001 = 0000000000001 > 0 这个样子的话 就证明 a重复了·
{
cout << "this is not the unique"<<endl;
break;
}
else
{
checker =checker |(1<<z);//0011 | 0100 =0111;
}
}
cout<<"unique"<<endl;
}
int main()
{
char a[] = "abcj";
int aio = 0;
//cout << "asdfasdf"<<endl;
system("pause");
}