U E D R , A S I H C RSS

데블스캠프2006/화요일/pointer/문제3/김준석

문제3 배열 크기 할당해서 보기

~cpp
#include<iostream>


using namespace std;


void main(){
	int *i = new int[4];
	int *a = new int[4];
	int *tmp  = new int[4];

	cin >> *i;
	cin >> *a;

	for(int j=0; j<4;j++)
     	tmp[j] = a[j] + i[j];

	cout << *tmp <<endl;
	
	delete [] i;
	delete [] a;
	delete [] tmp;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:06
Processing time 0.0097 sec