Trong bài toán này, cho chuỗi mật khẩu (password). Nhiệm vụ in * thay cho các ký tự của mật khẩu.
Ví dụ:
Input: password Output: ********
Giải pháp: duyệt mật khẩu đã nhập, in * thay mỗi ký tự.
Ví dụ
Chương trình minh họa giải pháp:
#include#include int main() { char password[50] = "password"; int length = strlen(password); printf("Password : "); for(int i = 0; i < length; i++){ printf("*"); } return 0; }
Kết quả
Password : ********