1234567891011121314151617181920
#define _CRT_NONSTDC_NO_WARNINGS #include <iostream> #include <conio.h> using namespace std; const int RETURN = 13; int main() { int ch = getch(); while (ch != RETURN) { cout << "*"; ch = getch(); } system("pause"); // remove if not using Visual Studio return 0; }
123456789101112131415161718192021222324252627282930313233343536
#include <iostream> #include <string> #include <iomanip> using namespace std; bool IsChar(char); int main() { int size; string str; cin >> str; size = str.length(); for(int i = 0; i < size; ++i) { if(IsChar(str[i])) { str[i] = '*'; } } cout << str << endl; return 0; } bool IsChar(char s) { return (isalpha(tolower(s))); }