y‰SŽÒнŒ}zC/C++Ž ..
[
2ch
|
¥Menu
]
¡ƒRƒsƒyƒ‚[ƒh
ƒXƒŒ‚ð’Êí•\ަ
ƒIƒvƒVƒ‡ƒ“ƒ‚[ƒh
‚±‚̽گÄÞ‚ÌURL
¡€–ÚƒeƒLƒXƒg
293:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ 07/11/14 13:50:32 ‚‚« bool Palindrome::isPalindrome(){ char *aux = new char[100]; int k=0; for(size_t i=0;i<strlen(this->inputValue);i++){ if((this->inputValue[i] >= 'A' && this->inputValue[i] <= 'Z') || (this->inputValue[i] >= 'a' && this->inputValue[i] <= 'z')){ aux[k] = tolower(this->inputValue[i]); k++; }} aux[k] = '\0'; for(size_t i=0;i<strlen(aux)/2;i++){ if(aux[i] != aux[strlen(aux) - 1 - i]){ delete [] aux; return false; }} delete [] aux; return true; } 294:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ 07/11/14 13:52:03 ‚‚« #include "Palindrome.cpp" #include <iostream> using namespace std; int main(){ Palindrome p; char string[100]; while(true){ cout<<"•¶Žš‚ð“ü—Í‚µ‚Ä‚‚¾‚³‚¢: "; cin.getline(string,100); if(strcmp(string,"") == 0){ break; } p.setInputValue(string); cout<<"‚»‚Ì•¶Žš‚Í "<<(p.isPalindrome() == true ? "‚̓pƒŠƒ“ƒhƒ[ƒ€‚Å‚· " : "ˆá‚¢‚Ü‚· ")<<endl; } return 0; }
ŽŸƒy[ƒW
ÅVƒŒƒX•\ަ
ƒXƒŒƒbƒh‚ÌŒŸõ
—ÞŽ—ƒXƒŒˆê——
˜b‘è‚̃jƒ…[ƒX
‚¨‚Ü‚©‚¹ƒŠƒXƒg
¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ
ƒŒƒXƒWƒƒƒ“ƒv
mixiƒ`ƒFƒbƒNI
Twitter‚É“Še
ƒIƒvƒVƒ‡ƒ“
‚µ‚¨‚è‚ð‹²‚Þ
ƒXƒŒƒbƒh‚É‘ž
ƒXƒŒƒbƒh‚̈ꗗ
‰É‚‚Ԃµ2ch
5008“ú‘O‚ÉXV/97 KB
’S“–:undef