#include <stdio.h>
#include <stdlib.h>
int password, passwordTemp, passwordCK;
int pwInput();
int pwChecked();
int compare();
int pwChanged();
int main() {
pwInput();
pwChecked();
compare();
printf("현재 비밀번호: %d\n", password);
pwChanged();
}
int pwInput(){
scanf("%d", &passwordTemp);
}
int pwChecked(){
scanf("%d", &passwordCK);
}
int compare(){
if(passwordTemp == passwordCK){
printf("비밀번호 생성 완료\n");
password = passwordTemp;
}else{
printf("비밀번호 생성 실패!\n");
printf("생성 실패로 인한 프로그램 종료\n");
exit(1);
}
}
int pwChanged(){
pwInput();
pwChecked();
if(passwordTemp == passwordCK){
printf("비밀번호 변경 완료\n");
password = passwordTemp;
printf("변경된 비밀번호: %d\n", password);
}else{
printf("비밀번호가 맞지 않아서 변경에 실패했습니다.\n");
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: