怎么用c++做一个小程序
时间: 2023-12-20 21:32:22 浏览: 71
c++的小程序
```c++
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!";
return 0;
}
```
```c++
#include <iostream>
using namespace std;
int main() {
int num1, num2, sum;
cout << "Enter two numbers: ";
cin >> num1 >> num2;
sum = num1 + num2;
cout << "Sum is: " << sum;
return 0;
}
```
阅读全文