Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int password;
- int savedPassword = 1488;
- int effort = 1;
- for ( int i = 0; i <= 4; i++ ) {
- if (scanf("%d", &password) != 1) {
- password = savedPassword+1;
- scanf("%*s");
- }
- if ( password != savedPassword ) {
- if ( effort == 5 ){
- printf("denied\n");
- return 0;
- }
- else {
- printf("incorrect password\n");
- effort += 1;
- }
- }
- else {
- printf("accepted\n");
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement