编程输出字符串"Hello world!"
时间: 2024-09-18 12:06:23 浏览: 52
探索Python编程的第一步:打印“Hello, World!”
在大多数编程语言中,输出字符串 "Hello world!" 都非常简单。下面是一些常见编程语言的例子:
1. **Python**:
```python
print("Hello world!")
```
2. **Java**:
```java
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
```
3. **JavaScript**:
```javascript
console.log("Hello world!");
```
4. **C++**:
```cpp
#include <iostream>
int main() {
std::cout << "Hello world!";
return 0;
}
```
5. **C#**:
```csharp
using System;
class Program {
static void Main(string[] args) {
Console.WriteLine("Hello world!");
}
}
```
阅读全文