Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //12.3
- #include <iostream>
- #include <queue>
- using namespace std;
- int main(){
- int n;
- cout<<" int n: ";
- cin>>n;
- int *a=new int[n];
- for (int i=0;i<n;i++){
- cin>>a[i];
- }
- for (int i=0;i<n;i++){
- try {
- if (a[i]<0){
- throw a[i];
- }
- } catch (int a) {
- cout <<"Exception trow :"<<" "<< a <<" ";
- }
- }
- delete[] a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement