#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main() {
bool hasDigit;
string passCode;
hasDigit = false;
cin >> passCode;
/* Your solution goes here */
for (int i=0; i<3; i++) {
if (isdigit(passCode[i]))
hasDigit = true;
}
if (hasDigit) {
cout << "Has a digit." << endl;
}
else {
cout << "Has no digit." << endl;
}
return 0;
}
Comments
Leave a comment