/*
#include <stdio.h>
int main()
{
int i,n,j,m=0,min=99;
for(i=0; i<7; i++)
{
scanf("%d", &n);
if(n%2==1)
{
m+=n;
if(n<min)
{
min=n;
}
}
}
if(m==0)
{
printf("-1");
}
else
{
printf("%d\n%d", m, min);
}
return 0;
}*/
/*
#include <stdio.h>
void f(int* pa)
{
*pa=300;
}
int main()
{
int a=10;
int* pa = &a;
printf("a : %d\n",a);
printf("&a : %d\n",&a);
printf("pa : %d\n",pa);
printf("*pa : %d\n",*pa);
// a=500;
*pa = 500;
printf("a : %d\n",a); //직접참조
printf("&a : %d\n",&a);
printf("pa : %d\n",pa);
printf("*pa : %d\n",*pa); //간접참조
f(&a);
printf("a : %d\n",a);
printf("&a : %d\n",&a);
printf("pa : %d\n",pa);
printf("*pa : %d\n",*pa);
}
scanf("%s",str);
str = &str[0]
*/
/*
#include <stdio.h>
void f(int* parr, int n)
{
printf("%d\n",*parr);
printf("%d\n",*(parr+1));
for(int i=0;i<n;i++)
{
//printf("%d\n", *(parr+i));
printf("%d\n",parr[i]);
}
}
int main()
{
int arr[5]={5,6,7,8,9};
f(arr,5);
}
*/
/*
#include <stdio.h>
void myswap(int* pa, int* pb)
{
int g;
if(*pa>*pb)
{
g=*pa;
pa=pb;
*pb=g;
}
}
main()
{
int a, b;
scanf("%d%d", &a, &b);
myswap(&a, &b);
printf("%d %d", a, b);
}
*/
/*
#include <stdio.h>
char mysubstr(char str, int a, int n)
{
int i;
for(i=a; i<a+n; i++)
{
printf("%c", str[i]);
}
}
int main()
{
int a,n;
char str[101]={};
scanf("%s %d %d", str, &a, &n);
mysubstr(str,a,n);
}
*/
/*
#include <stdio.h>
char mysubstr(char str, int a, int n)
{
int i;
for(i=a-1; i<n; i++)
{
printf("%c", str[i]);
}
}
int main()
{
int a,n;
char str[101];
scanf("%s %d %d", str, &a,&n);
mysubstr(str,a,n);
return 0;
}
#include <stdio.h>
#include <windows.h>
void move(int x, int y)
{
COORD Pos; //x, y를 가지고 있는 구조체
Pos.X = x;
Pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Pos);
}
int main()
{
SetConsoleTitle( "유민이의 미니콘솔게임" ); //창 제목 바꾸기
system( "mode con lines=20 cols=100" ); //콘솔창 크기 바꾸기
for(;;)
{
move(30,5);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),10); //0~15 글자 색상바꾸기
printf("hello world");
Sleep(1000); // 1000 = 1초
system("cls"); //콘솔창 다 지우기
move(30,10);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),1);
printf("bye world");
Sleep(1000);
system("cls");
}
return 0;
}
*/
#include <stdio.h>
#include <windows.h> //콘솔
#include <stdlib.h> //랜덤
#include <time.h> //랜덤
void move(int x, int y)
{
COORD Pos;
Pos.X = x;
Pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Pos);
}
int main()
{
int x, y;
srand(time(NULL));
SetConsoleTitle( "유민이의 미니콘솔게임" );
for(;;)
{
x = rand()%50;
y = rand()%20 ; // 0 ~ 19의 랜덤 숫자
move(x,y);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14); //0~15 글자 색상바꾸기
printf("///");
Sleep(1000); // 1000 = 1초
system("cls"); //콘솔창 다 지우기
move(25,15);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
printf("*o*:'o*^Merry");
Sleep(1000);
move(25,16);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
printf("•。★Christmas★ 。* 。");
Sleep(1000);
move(25,17);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
printf("° 。 ° ˚* Π____*。*˚*");
Sleep(1000);
move(25,18);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
printf("˚ ˛ •˛•*/______/~\。˚ ˚ ˛*");
Sleep(1000);
move(25,19);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
printf("˚ ˛ •˛• | 田田|門| ˚And a Happy New Year!");
Sleep(1000);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),13);
printf("");
Sleep(1000);
system("cls");
}
return 0;
}