[转载] how to kill a program in a batch file?# Unix - 噫吁兮,危乎高哉
T*B
1 楼
【 以下文字转载自 Linux 讨论区,原文如下 】
发信人: TFIIB (小明), 信区: Linux
标 题: how to kill a program in a batch file?
发信站: Unknown Space - 未名空间 (Wed Nov 5 22:46:02 2003) WWW-POST
#include
using namespace std;
int main() {
int i, j, k;
cin >> i;
cin >> j;
cout << i+j << endl;
cin >> k; // I want to exit here.
cout << k;
}
I need to exit the program when i+j is printed and I am prompted to
enter k.
For example, the execution of this program would be like this:
>./a.out
>5
>6
11
>^c
发信人: TFIIB (小明), 信区: Linux
标 题: how to kill a program in a batch file?
发信站: Unknown Space - 未名空间 (Wed Nov 5 22:46:02 2003) WWW-POST
#include
using namespace std;
int main() {
int i, j, k;
cin >> i;
cin >> j;
cout << i+j << endl;
cin >> k; // I want to exit here.
cout << k;
}
I need to exit the program when i+j is printed and I am prompted to
enter k.
For example, the execution of this program would be like this:
>./a.out
>5
>6
11
>^c