Registry Mirror
搜索
Skip to content
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Files
Expand file tree
master
Breadcrumbs
learn-cpp
/
4-loops
/
enter_pin.cpp
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
26 lines (16 loc) · 385 Bytes
master
Breadcrumbs
learn-cpp
/
4-loops
/
enter_pin.cpp
Copy path
Top
File metadata and controls
Code
Blame
26 lines (16 loc) · 385 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
int main() {
int pin = 0;
int tries = 0;
std::cout << "BANK OF CODECADEMY\n";
std::cout << "Enter your PIN: ";
std::cin >> pin;
while (pin != 1234) {
std::cout << "Wrong PIN. Try again: ";
std::cin >> pin;
tries++;
}
std::cout << "PIN accepted!\n";
std::cout << "You now have access.\n";
return 0;
}
You can’t perform that action at this time.