"함수 print()"의 두 판 사이의 차이

30번째 줄: 30번째 줄:
==Go==
==Go==
[[분류: Go]]
[[분류: Go]]
{{참고|Go Println()}}
{{참고|Go Print()}}
<source lang='go'>
<source lang='go'>
package main
package main

2020년 7월 15일 (수) 20:19 판

  다른 뜻에 대해서는 리눅스 echo 문서를 참조하십시오.
echo
print
Write

1 Bash

echo "Hello World!"
# Hello World!
STR="Hello World!"
echo $STR
# Hello World!
echo -n 123
echo -n ABC
# 123ABC

2 C#

Console.Write("Hello");

3 Go

package main

import "fmt"

func main() {
    fmt.Print("hello" + "world")
    fmt.Print("1+1=", 1+1)
    // helloworld1+1=2
}

4 JavaScript

document.write("hello");

5 Perl

print 'hello';

6 PHP

echo 'hello';
echo "hello";
echo('hello');
echo("hello");

$greeting = 'hello';
$greeting = "hello";
echo $greeting;
echo "$greeting";
echo '123';
echo 'ABC';
// 123ABC
print 'hello';

7 PowerShell

Write-Host "Hello world!"

8 Python

  • Python 2.x
import sys
sys.stdout.write("hello")
  • Python 3.x
print('hello')
print("hello")
print("hello", end="")
# hello
print("hello","world")
# hello world
print("hello", "world", end="123")
# hello world123

9 R

print(1)
## [1] 1
print(1:3)
## [1] 1 2 3
print('hello')
## [1] "hello"
print("hello")
## [1] "hello"

10 Ruby

print "hello"
# hello
print "123"
print "ABC"
# 123ABC

11 VB

PRINT "hello"

12 같이 보기