日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

a开头的计算机语言,我们刚开始接触计算机语言大多从Hello world 开始

發(fā)布時間:2025/3/15 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 a开头的计算机语言,我们刚开始接触计算机语言大多从Hello world 开始 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

該樓層疑似違規(guī)已被系統(tǒng)折疊?隱藏此樓查看此樓

char?szClassName[]?=?"MainWnd";

HINSTANCE?hInstance;

int?WINAPI?WinMain(HINSTANCE?hInst,?HINSTANCE?hPrevInstance,?LPSTR?lpCmdLine,?int?nCmdShow)

{

HWND?hwnd;

MSG?msg;

WNDCLASSEX?wincl;

hInstance?=?hInst;

wincl.cbSize?=?sizeof(WNDCLASSEX);

wincl.cbClsExtra?=?0;

wincl.cbWndExtra?=?0;

wincl.style?=?0;

wincl.hInstance?=?hInstance;

wincl.lpszClassName?=?szClassName;

wincl.lpszMenuName?=?NULL;?//No?menu

wincl.lpfnWndProc?=?WindowProcedure;

wincl.hbrBackground?=?(HBRUSH)(COLOR_WINDOW?+?1);?//Color?of?the?window

wincl.hIcon?=?LoadIcon(NULL,?IDI_APPLICATION);?//EXE?icon

wincl.hIconSm?=?LoadIcon(NULL,?IDI_APPLICATION);?//Small?program?icon

wincl.hCursor?=?LoadCursor(NULL,?IDC_ARROW);?//Cursor

if?(!RegisterClassEx(&wincl))

return?0;

hwnd?=?CreateWindowEx(0,?//No?extended?window?styles

szClassName,?//Class?name

"",?//Window?caption

WS_OVERLAPPEDWINDOW?&?~WS_MAXIMIZEBOX,

CW_USEDEFAULT,?CW_USEDEFAULT,?//Let?Windows?decide?the?left?and?top?positions?of?the?window

120,?50,?//Width?and?height?of?the?window,

NULL,?NULL,?hInstance,?NULL);

//Make?the?window?visible?on?the?screen

ShowWindow(hwnd,?nCmdShow);

//Run?the?message?loop

while?(GetMessage(&msg,?NULL,?0,?0))

{

TranslateMessage(&msg);

DispatchMessage(&msg);

}

return?msg.wParam;

}

LRESULT?CALLBACK?WindowProcedure(HWND?hwnd,?UINT?message,?WPARAM?wParam,?LPARAM?lParam)

{

PAINTSTRUCT?ps;

HDC?hdc;

switch?(message)

{

case?WM_PAINT:

hdc?=?BeginPaint(hwnd,?&ps);

TextOut(hdc,?15,?3,?"Hello,?world!",?13);

EndPaint(hwnd,?&ps);

break;

case?WM_DESTROY:

PostQuitMessage(0);

break;

default:

return?DefWindowProc(hwnd,?message,?wParam,?lParam);

}

return?0;

}

基于web圖形用戶界面

Java?applet

Java?applets?work?in?conjunction?with?HTML?files.

HelloWorld?Program?says:

import?java.applet.*;

import?java.awt.*;

public?class?HelloWorld?extends?Applet?{

public?void?paint(Graphics?g)?{

g.drawString("Hello,?world!",?100,?50);

}

}

JavaScript,?aka?ECMAScript

JavaScript?is?a?scripting?language?used?in?HTML?files.?To?demo?this?program?Cut?and?Paste?the?following?code?into?any?HTML?file.

οnclick="javascript:helloWorld();">Hello?World?Example

An?easier?method?uses?JavaScript?implicitly,?calling?the?reserved?alert?function.?Cut?and?paste?the?following?line?inside?the?....?HTML?tags.

Hello?World?Example

An?even?easier?method?involves?using?popular?browsers'?support?for?the?virtual?'javascript'?protocol?to?execute?JavaScript?code.?Enter?the?following?as?an?Internet?address?(usually?by?pasting?into?the?address?box):

javascript:alert('Hello,?world!')

XUL

http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

文檔格式

ASCII

The?following?sequence?of?characters,?expressed?in?hexadecimal?notation?(with?carriage?return?and?newline?characters?at?end?of?sequence):

48?65?6C?6C?6F?2C?20?77?6F?72?6C?64?21?0D?0A

HTML

Hello,?world!

PostScript

/font?/Courier?findfont?24?scalefont

font?setfont

100?100?moveto

(Hello?world!)?show

showpage

TeX

\font\HW=cmr10?scaled?3000

\leftline{\HW?Hello?world}

\bye

總結(jié)

以上是生活随笔為你收集整理的a开头的计算机语言,我们刚开始接触计算机语言大多从Hello world 开始的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。