HELLO_HELL?

블로그 이미지

준P

'Development'에 해당되는 글 44건

제목 날짜
  • c언어에서 소리출력하기!!! 2013.12.31
  • 정보올림피아드 본선 - 문제코드 : 2262 2013.12.31
  • URLDownloadToFile 예제 2013.12.31
  • 콘솔에서 이미지출력 예제 2013.12.31

c언어에서 소리출력하기!!!

Development/C/C++ 2013. 12. 31. 22:07
#include<stdio.h>
#include<Windows.h>
#include<MMSystem.h>
#pragma comment(lib,"Winmm.lib")

int main(void)
{
sndPlaySoundA("C:\\a.wav",SND_ASYNC|SND_NODEFAULT); // 음악연주 C:\\~~~ 는 경로명을 입력합니다. (단, 폴더를 구분하는 역슬래쉬는 2번 써 줘야 합니다. 예) C:\test\aa.wav  일 경우 "C:\\test\\aa.wav"
system("pause");
return 0;
}

이소스를 실행하면 c언어에서 소리가나옴니다.

system("pause");
위 함수는않넣으셔두되지만 실행시 바로 종료가되버려서 넣어주시기바람니다.


저작자표시 비영리 변경금지 (새창열림)

'Development > C/C++' 카테고리의 다른 글

c++) hello hell!! , namespace 그리고 시작하기 앞서  (0) 2014.07.12
c언어) 특수 문자와 변수 설명  (0) 2014.04.17
정보올림피아드 본선 - 문제코드 : 2262  (0) 2013.12.31
URLDownloadToFile 예제  (0) 2013.12.31
콘솔에서 이미지출력 예제  (0) 2013.12.31
Posted by 준P

정보올림피아드 본선 - 문제코드 : 2262

Development/C/C++ 2013. 12. 31. 22:06

주사위 세개
Time Limit : 1000MS

문제 
1에서부터 6까지의 눈을 가진 3개의 주사위를 던져서 다음과 같은 규칙에 따라 상금을 받는 게임이 있다.

규칙(1) 같은 눈이 3개가 나오면 10,000원+(같은 눈)*1,000원의 상금을 받게 된다. 
규칙(2) 같은 눈이 2개만 나오는 경우에는 1,000원+(같은 눈)*100원의 상금을 받게 된다. 
규칙(3) 모두 다른 눈이 나오는 경우에는 (그 중 가장 큰 눈)*100원의 상금을 받게 된다.

예를 들어, 3개의 눈 3, 3, 6이 주어지면 상금은 1,000+3*100으로 계산되어 1,300원을 받게 된다. 또 3개의 눈이 2, 2, 2로 주어지면 10,000+2*1,000 으로 계산되어 12,000원을 받게 된다. 3개의 눈이 6, 2, 5로 주어지면 그중 가장 큰 값이 6이므로 6*100으로 계산되어 600원을 상금으로 받게 된다.

3개 주사위의 나온 눈이 주어질 때, 상금을 계산하는 프로그램을 작성 하시오.

입력형식 
첫 째 줄에 3개의 눈이 빈칸을 사이에 두고 각각 주어진다.

출력형식 
첫째 줄에 게임의 상금을 출력 한다.

입력 예
3 3 6

출력 예
1300

입력 예
2 2 2

출력 예
12000

입력 예
6 2 5

출력 예
600


#include <stdio.h>
int main()
{
int j, inputs[3], max=0, sum=0;
printf("주사위의 숫자를 입력해 주십시요");
for(j=0;j<3;j++)
{
scanf_s("%d", &inputs[j]);
for(;;)
{
if(inputs[j]>6||inputs[j]<=0)
{
printf("숫자가 0이하이거나 6보다 큼니다!!\n다시입력해주십시오\n");
scanf_s("%d", &inputs[j]);
}
else if(inputs[j]<=6||inputs[j]>0)
break;
}
if(max<inputs[j])
max=inputs[j];
}
if(inputs[0]==inputs[1]&&inputs[1]==inputs[2])
sum=10000+inputs[0]*1000;
else if(inputs[0]==inputs[1]&&inputs[1]!=inputs[2])
sum=1000+inputs[0]*100;
else if(inputs[0]=!inputs[1]&&inputs[1]==inputs[2])
sum=1000+inputs[1]*100;
else if(inputs[0]==inputs[2]&&inputs[0]!=inputs[1])
sum=1000+inputs[0]*100;
else if(inputs[0]!=inputs[1]&&inputs[2]!=inputs[1])
sum=max*100;
printf("%d", sum);
}


저작자표시 비영리 변경금지 (새창열림)

'Development > C/C++' 카테고리의 다른 글

c++) hello hell!! , namespace 그리고 시작하기 앞서  (0) 2014.07.12
c언어) 특수 문자와 변수 설명  (0) 2014.04.17
c언어에서 소리출력하기!!!  (0) 2013.12.31
URLDownloadToFile 예제  (0) 2013.12.31
콘솔에서 이미지출력 예제  (0) 2013.12.31
Posted by 준P

URLDownloadToFile 예제

Development/C/C++ 2013. 12. 31. 22:06
#include <stdio.h>
#include <conio.h>
#include <UrlMon.h>
#pragma comment(lib,"UrlMon.lib")
int main(){
 int num;
printf("[BlackRose] V3 설치파일 다운로드 : 1 종료 : 2\n\n명령입력 :");
scanf("%d",&num);
switch(num){
case 1:
URLDownloadToFile (NULL, "http://v3lite.v3webhard.com/download/V3LiteSG_Setup.exe", "C:\\V3LiteSG_Setup.exe", 0, NULL);
getch();
case 2:
exit(0);
default :
printf("명령을 잘못입력하셨습니다.\n");
}
getch();
return 0;
}

URLDownloadToFile (NULL, "http://v3lite.v3webhard.com/download/V3LiteSG_Setup.exe", "C:\\V3LiteSG_Setup.exe", 0, NULL);
요게 젤중요..

v3lite다운할게에여.c드라이브폴더에..


저작자표시 비영리 변경금지 (새창열림)

'Development > C/C++' 카테고리의 다른 글

c++) hello hell!! , namespace 그리고 시작하기 앞서  (0) 2014.07.12
c언어) 특수 문자와 변수 설명  (0) 2014.04.17
c언어에서 소리출력하기!!!  (0) 2013.12.31
정보올림피아드 본선 - 문제코드 : 2262  (0) 2013.12.31
콘솔에서 이미지출력 예제  (0) 2013.12.31
Posted by 준P

콘솔에서 이미지출력 예제

Development/C/C++ 2013. 12. 31. 22:03
#include<stdio.h>
#include<Windows.h>
 
int main(void)
{
HINSTANCE hInstance = GetModuleHandle(NULL);
HWND hWnd =FindWindow("ConsoleWindowClass",NULL);
HBITMAP hImage,hOldBitmap;

HDC hdc    = GetDC(hWnd);
HDC hMemDC = CreateCompatibleDC(hdc);
// 이미지 로드
hImage = (HBITMAP) LoadImage(NULL,
                        TEXT("zero.bmp"),
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION);
// 이미지 출력 부분
hOldBitmap = (HBITMAP) SelectObject(hMemDC,hImage);
BitBlt(hdc,0,0,328,235,hMemDC,0,0,SRCCOPY);

    // 각종 메모리 해제 
SelectObject(hMemDC,hOldBitmap);
DeleteObject(hImage);
DeleteDC(hMemDC);
ReleaseDC(hWnd,hdc);

system("pause");
 return 0;
}


저작자표시 비영리 변경금지 (새창열림)

'Development > C/C++' 카테고리의 다른 글

c++) hello hell!! , namespace 그리고 시작하기 앞서  (0) 2014.07.12
c언어) 특수 문자와 변수 설명  (0) 2014.04.17
c언어에서 소리출력하기!!!  (0) 2013.12.31
정보올림피아드 본선 - 문제코드 : 2262  (0) 2013.12.31
URLDownloadToFile 예제  (0) 2013.12.31
Posted by 준P
이전페이지 다음페이지
블로그 이미지

by 준P

공지사항

    최근...

  • 포스트
  • 댓글
  • 트랙백
  • 더 보기

태그

글 보관함

«   2025/10   »
일 월 화 수 목 금 토
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

링크

카테고리

HELLO? (157)
스터디 (6)
Windows 구조와 원리 OS를 관통하는 프로그.. (6)
Development (44)
Android (5)
Assembly (4)
C/C++ (11)
C# (0)
HTML (1)
JAVA (2)
JSP (3)
JS Script (2)
Linux Shell Script (2)
Open GL (1)
PHP (0)
Python (1)
QT library (3)
SQL (1)
Swift (1)
MongoDB (0)
Express JS (1)
Angular JS (1)
Node JS (1)
SpongePoweredForgePluginDev.. (2)
Unity3d (1)
Docker (0)
Linux (22)
Linux Kernel Study (1)
Network (9)
WireShark (1)
Network Theory (6)
Hack the packet 2013 (2)
Reversing (50)
Windows PE (10)
Windows Reversing (1)
Linux PE (0)
Linux Reversing (0)
Android Reversing (2)
Reversing Tools (8)
CodeEngn (25)
Reversing.kr (2)
abex's (2)
Sites (3)
System (12)
FTZ (9)
Buffer Over Flow (3)
GDGkr (1)

카운터

Total
Today
Yesterday
방명록 : 관리자 : 글쓰기
준P's Blog is powered by daumkakao
Skin info material T Mark3 by 뭐하라
favicon

HELLO_HELL?

  • 태그
  • 링크 추가
  • 방명록

관리자 메뉴

  • 관리자 모드
  • 글쓰기
  • HELLO? (157)
    • 스터디 (6)
      • Windows 구조와 원리 OS를 관통하는 프로그.. (6)
    • Development (44)
      • Android (5)
      • Assembly (4)
      • C/C++ (11)
      • C# (0)
      • HTML (1)
      • JAVA (2)
      • JSP (3)
      • JS Script (2)
      • Linux Shell Script (2)
      • Open GL (1)
      • PHP (0)
      • Python (1)
      • QT library (3)
      • SQL (1)
      • Swift (1)
      • MongoDB (0)
      • Express JS (1)
      • Angular JS (1)
      • Node JS (1)
      • SpongePoweredForgePluginDev.. (2)
      • Unity3d (1)
    • Docker (0)
    • Linux (22)
    • Linux Kernel Study (1)
    • Network (9)
      • WireShark (1)
      • Network Theory (6)
      • Hack the packet 2013 (2)
    • Reversing (50)
      • Windows PE (10)
      • Windows Reversing (1)
      • Linux PE (0)
      • Linux Reversing (0)
      • Android Reversing (2)
      • Reversing Tools (8)
      • CodeEngn (25)
      • Reversing.kr (2)
      • abex's (2)
    • Sites (3)
    • System (12)
      • FTZ (9)
      • Buffer Over Flow (3)
    • GDGkr (1)

카테고리

PC화면 보기 티스토리 Daum

티스토리툴바