#include <iostream>
int main()
{
char username[15];
char password[15];
std::cout << "Hello, please login to continue your action.<Max 15 Char>" << std::endl;
std::cout << "Username: ";
std::cin >> username;
std::cout << "Password: ";
std::cin >> password;
if (username == "User" && password == "qwerty")
{
std::cout << "Hello, creator.";
}
else
{
std::cout << "Invalid Login";
}
/*23 row*/ std::cout << std::endl << std::endl << "Username=" <<username << std::endl << "Password=" << password;
std::cout << std::endl << std::endl << "Press …Run Code Online (Sandbox Code Playgroud) 我真的不知道后缀.我知道它首先使用标识符然后增加或减少,如第一次显示i然后++.但现在我认为我错了,仍然不明白.
#include <iostream>
using namespace std;
int main()
{
int i = 0;
cout << i << i++ << i;
cout << "\n\n\nPress Enter to close the window . . . ";
cin.clear();
cin.sync();
cin.get();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出:
101
Press Enter to close the window . . .
Run Code Online (Sandbox Code Playgroud)
首先i在增量加入之前改变.为什么?
我期望
001
Press Enter to close the window . . .
Run Code Online (Sandbox Code Playgroud)
有人可以解释.
c++ ×2