Difference between revisions of "Salutare lume!"
From linux360
(→C++: Fixed section title) |
(Resorted snippets into alphabetical order) |
||
| Line 6: | Line 6: | ||
Urmează exemplele: | Urmează exemplele: | ||
| − | == | + | ==BASIC== |
| + | <code><basic/>10 PRINT "Hello, world!" | ||
| + | 20 STOP</code> | ||
| + | |||
| + | ==Bourne Again Shell== | ||
<code><sh/>#!/bin/bash | <code><sh/>#!/bin/bash | ||
echo "Hello, world!" | echo "Hello, world!" | ||
exit 0</code> | exit 0</code> | ||
| − | |||
| − | |||
| − | |||
| − | |||
==ANSI C== | ==ANSI C== | ||
| Line 34: | Line 34: | ||
return 0; | return 0; | ||
| + | }</code> | ||
| + | |||
| + | ==Java== | ||
| + | <code><java/>public class MainApplication { | ||
| + | public static void main(String args[]) { | ||
| + | System.out.println("Hello, world!"); | ||
| + | } | ||
}</code> | }</code> | ||
| Line 51: | Line 58: | ||
</body> | </body> | ||
</html></code> | </html></code> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
[[Category:Collection]] | [[Category:Collection]] | ||
[[Category:Programming]] | [[Category:Programming]] | ||
Revision as of 00:15, 18 January 2006
Introducere
Am creeat acest articol din dorinţa de a arăta lumii diversitatea limbilor existente în informatică.
Ceea ce urmează sunt moduri de a spune atât de cunoscutul Salutare, lume! (<eng. Hello, world!) în diverse limbaje de programare. Puteţi adăuga exemple noi cu condiţia să fie corecte programatic, să fie tratate în varianta standard a limbajului folosit şi să rămână sortate în ordine alfabetică.
Urmează exemplele:
BASIC
<basic/>10 PRINT "Hello, world!"
20 STOP
Bourne Again Shell
<sh/>#!/bin/bash
echo "Hello, world!" exit 0
ANSI C
<c/>#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
return 0;
}
ANSI C++
<cpp/>#include <iostream>
using namespace std;
int main(void) {
cout << "Hello, world!" << endl;
return 0;
}
Java
<java/>public class MainApplication {
public static void main(String args[]) {
System.out.println("Hello, world!");
}
}
Pascal
<pascal/>program HelloWorld;
begin
writeln('Hello, world!');
end.
PHP
<html/><html>
<body>
<?php
echo "Hello, world!";
?>
</body>
</html>
