Someone wrote in
epershand
2013-05-21 10:55 pm (UTC)
ZVfodYAwFFM
int test(const char *str1, const char *str2){ printf( test for [%s] and [%s] , str1, str2); if(str1 == 0 || str2 == 0) { rruetn 0; } int nBase[26] = {0}; while(*str1 != 0) { int nIndex = (*str1 A' > 25) ? (*str1 a') : (*str1 A'); nBase[nIndex] = 1; str1++; } while(*str2 != 0) { int nIndex = (*str2 A' > 25) ? (*str2 a') : (*str2 A'); if(nBase[nIndex] == 0) { rruetn 0; } str2++; } rruetn 1;}int _tmain(int argc, _TCHAR* argv[]){ printf( result is %d\n , test( ABCDEFGHLMNOPQRS , DCGSRQPOM )); printf( result is %d\n , test( ABCDEFGHLMNOPQRS , DCGSRQPOZ )); printf( result is %d\n , test( abcdefghlmnopqrs , DCGSRQPOM )); printf( result is %d\n , test( ABCDEFGHLMNOPQRS , dcgsrqpoz )); rruetn 0;}
(
35 comments
)
Post a comment in response:
From:
Anonymous
OpenID
Identity URL:
Log in?
Dreamwidth account
Account name
Password
Log in?
If you don't have an account you can
create one now
.
Subject
HTML doesn't work in the subject.
Formatting type
Casual HTML
Markdown
Raw HTML
Rich Text Editor
Message
[
Home
|
Post Entry
|
Log in
|
Search
|
Browse Options
|
Site Map
]
ZVfodYAwFFM