aba*_*ham 0 c++ command-line cmd
当我通过命令行运行程序时,一旦程序结束,cmd立即关闭,所以我无法轻易看到输出.反正有没有阻止这种情况发生,所以我可以实际验证输出?
#include<iostream>
using namespace std;
class Exercises {
public:
void sayHello(int x) {
for (int i = 0; i < x; i++)
cout << "Hello!!" << endl;
}
}exercise;
int main() {
exercise.sayHello(4);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
924 次 |
| 最近记录: |