#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <conio.h>
#include <windows.h>
#define MIN 11
#define MAX 99
#define N 35
#define ROWS 7
#define COLS 5
#define col GetStdHandle(STD_OUTPUT_HANDLE)
int help(void);
void gotoxy(int x, int y)
{
COORD pos = {x, y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
void main()
{
int num[35] = {0};
int i, j, num1, num2;
int index1, index2;
int x1, x2, y1, y2;
srand(time(NULL));
for (i=0;i<N;i++) {
num1 = rand()% (MAX - MIN + 1)+ MIN;
do {
num2 = rand()% (MAX - MIN + 1)+ MIN;
} while (num1 == num2);
num[i] = num1 * 100 + num2;
}
index1 = rand() % N + 1;
do {
index2 = rand() % N + 1;
} while (index1 == index2);
printf("==============내손의 보안카드 ");
for (i=0;i<ROWS;i++) {
for (j=0;j<COLS;j++)
printf("[d]:- - ", j*ROWS + i + 1, num[j*ROWS + i]/100, num[j*ROWS + i]0);
printf(" ");
}
printf("======인터넷 뱅킹 화면 ");
for (i=0;i<ROWS;i++) {
for (j=0;j<COLS;j++)
if ( (j*ROWS + i + 1) == index1)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xfc);
printf("[d]:] ", j*ROWS + i + 1, num[j*ROWS + i]0);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xf0);
x1 = 11*j + 5;
y1 = 9 + i;
}
else if ( (j*ROWS + i + 1) == index2)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xf9);
printf("[d]:- ", j*ROWS + i + 1, num[j*ROWS + i]/100);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xf0);
x2 = 11*j + 8;
y2 = 9 + i;
}
else
printf("[d]:- - ", j*ROWS + i + 1, num[j*ROWS + i]/100, num[j*ROWS + i]0);
printf(" ");
}
while (1) {
char ch1, ch2;
gotoxy(0,16);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xf0);
printf("================================= ");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xfc);
printf("[d] 번 앞의 두자리 입력 :[ ]**", index1);
printf(" ");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xf9);
printf("[d] 번 뒤의 두자리 입력 :**[ ]", index2);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xf0);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xfc);
gotoxy(27, 17);
ch1 = getch(); putchar('*');
gotoxy(x1,y1);
putchar('*');
gotoxy(28, 17);
ch2 = getch(); putchar('*');
gotoxy(x1+1,y1);
putchar('*');
num1 = (ch1 - '0')*10 + (ch2 - '0');
gotoxy(29, 18);
getch();SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xf9);
ch1 = getch(); putchar('*');
gotoxy(x2,y2);
putchar('*');
gotoxy(30, 18);
ch2 = getch(); putchar('*');
gotoxy(x2+1,y2);
putchar('*');
num2 = (ch1 - '0')*10 + (ch2 - '0');
printf(" ");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xfc);
gotoxy(0, 20);
if (num[index1-1]/100 == num1 && num[index2-1]0==num2) {
printf("맞았습니다. ");
break;
} else
printf("틀렸습니다. ");
gotoxy(x1,y1);
printf(" ");
gotoxy(x2,y2);
printf(" ");
}
}
ㅋㅋㅋㅋ 학교휴학하고 혼자 프로그래밍공부하길 잘한듯 너무재밋음
내가 희열감 느낀건 무엇보다도 * 동시에 2개 입력하게 만드는거랑 색깔넣는거
인터넷에서 찾아가면서 넣은거임
어렵네요
기내요
보안카드 소스 공개하면 더이상 보안은...
이거 내가 만든건데 어디서 배끼거나 그러지 않고 혼자만들었기때문에 이런식으로 되있을리없음
아 물론 프갤은 농담따먹기하는 갤입니다.
칭찬받고십습니꽈? - DCW
ㄴㄴ 중딩2가 올려달라기에 올린거 소스올리고 싶은마음 없었음
실행한 스샷 올려주면 안되요?
귀찮음ㅋㅋ 그냥 비쥬얼스튜디오에 복사해서 돌리면 될거를