No older revisions available
No older revisions available
~cpp
#include <iostream>
using namespace std;
void main()
{
int *num1 = new int[5] ;
int *num2 = new int[5] ;
int *result = new int[5];
int i,j;
cout << "8개를 입력해 주세요.";
for(i=0;i<4;i++){
cin >> num1[i];
}
for(i=0;i<4;i++){
cin >> num2[i];
}
for(i=0; i<5; i++){
result[i] = num1[i] + num2[i];
}
for(i=0; i<4 ; i++){
cout << num1[i];
}
cout <<endl;
for(i=0; i<4 ; i++){
cout << num2[i];
}
cout <<endl;
for(i=0; i<4 ; i++){
cout << result[i] ;
}
cout <<endl;
delete [] num1;
delete [] num2;
delete [] result;
}