MultiD.cpp
上传用户:sz0451
上传日期:2022-07-29
资源大小:256k
文件大小:1k
- // This is the main project file for VC++ application project
- // generated using an Application Wizard.
- #include "stdafx.h"
- #using <mscorlib.dll>
- using namespace System;
- // This is the entry point for this application
- #ifdef _UNICODE
- int wmain(void)
- #else
- int main(void)
- #endif
- {
- Console::WriteLine(S"Multidimensional Arrays");
- // Create a 2D array
- int arr[2][3];
- // Fill the array
- for(int i=0; i<2; i++)
- for(int j=0; j<3; j++)
- arr[i][j] = (i+1)*(j+1);
- // Print the array content
- for(int i=0; i<2; i++)
- {
- for(int j=0; j<3; j++)
- Console::Write("{0} ", __box(arr[i][j]));
- Console::WriteLine();
- }
- return 0;
- }