08/02/11 20:00:14
>>186
#include <iostream>
using namespace std;
bool hasDigit( const char* pstr )
{
while(*pstr) {
if( isdigit(*pstr) )
return true;
pstr ++;
}
return false;
}
int main()
{
while(1) {
cout << "入力=";
char sz[50];
cin.getline( sz, sizeof(sz) );
if( !hasDigit( sz ) ) {
char* p;
for( p=sz; *p=='a'; p++ );
cout << "出力=" << p << "\n";
break;
} else {
cout << "数値が含まれるので、再度入力してください。\n";
}
}
return 0;
}