Em chưa rành C++ nên mọi người giúp e chuyển sang c++ với ạ
#include <stdio.h>
#include <string.h>
int main()
{
// username and password we have
char username[] = "abcdefghabcdefgh";
char passwrod[] = "123456789";
char user[50], pass[50];
printf("Enter your username: ");
gets(user);
printf("Enter your password: ");
gets(pass);
while(strcmp(user, username) != 0 || strcmp(pass, passwrod) != 0) {
printf("\nusername or passwrod incorrect\n");
printf("Enter your username: ");
gets(user);
printf("Enter your password: ");
gets(pass);
}
printf("Login success!\n");
return 0;
}