처음만든 계산프로그램에 password를 걸고싶은데
if 문으로 나름대로 해봤지만 처음인지라에러만 계속 뜨네요;;
패스워드 거는 방법좀 알려주세요.
#include<stdio.h>
#include<conio.h>
void main()
{
double z,x,c,r,g;
char d;
clrscr();
printf("The operation program");
printf("\n Wirte the Password--->");
scanf("%c",d);
if('Agreeni'(char)==d)
printf("\nInput the first number.--->");
scanf("%lf",&z);
printf("Input the second number.--->");
scanf("%lf",&x);
c=z+x;
printf("%lf+%lf=%lf",z,x,c);
printf("\n%lf",c);
printf("\nInput the answer--->");
scanf("%lf",&c);
printf("\nInput the another number--->");
scanf("%lf",&r);
g=c/r;
printf("%lf/%lf=%lf",c,r,g);
printf("%lf",g);
if('Agreeni'(char)<d)
printf("This is not password");
}
좋은답변 부탁드립니다.
|