Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- #include "conio.h"
- int _tmain(int argc, _TCHAR* argv[])
- {
- //1
- //int a[] = {0,5,7,4,1,5,4,6,0,8};
- //cout<<sizeof(a)/sizeof(int)<<' '<<sizeof(a[0])<<' '<<sizeof(a);
- //
- //3
- //int a[][3] = {{4,8},{2,8},{2,0},{9,5},{5,9}};
- //cout<<sizeof(a)/sizeof(int)<<' '<<sizeof(a[0])<<' '<<sizeof(a[3][2]);
- //2
- //int a[][3] = {3,2,5,3,3,6,1,6,0,7};
- //cout<<sizeof(a)/sizeof(int)<<' '<<sizeof(a[0])/sizeof(int)<<' '<<sizeof(a);
- //
- //4
- //int a[][3] = {{4,7,1},{1,1},{8},7,3,5,0};
- //cout<<sizeof(a)/sizeof(int)<<' '<<sizeof(a[3])<<' '<<sizeof(a);
- //
- //5
- //int a[][5] = {{3,5,4,7,5},{6,6,9,9,1},{5,6,2,9,0},{6,8,4,6,6},{9,1,0,2,5}};
- //cout<<a[3][4]<<' '<<*(a[3]+2)<<' '<<*a[2]+3;
- //
- //
- //6
- //int a[5][2] = {{9,5},{0,7},{2,7},{0,2},{2,0}};
- //cout<< a[2][1] <<' '<<(*(a+4))[1]<<' '<<*(*(a+1)+1);
- //7
- //int i=3, j=9, k ,l, **a=new int*[i];
- //for(k=0;k<i;k++)
- //{
- // a[k] = new int[j];
- // for (l = 0; l < j; l++) a[k][l] = 10*k+l;
- //}
- //
- //for (k=0; k<i; k++) cout<<' '<<a[k][k];
- //for (k=0; k<i; k++) delete[]a[k]; delete[]a;
- //8
- //char *s = "iahlcxvefjlehr";
- //int i,a[] = {8,1,9,0,3};
- //for (i=0; i<sizeof(a)/sizeof(a[0]); i++)
- //cout<<s[a[i]];
- ////9
- //
- //char *s = "DGKWQNZZFWWCDW",
- //*p[] = {s+3,s+3,s+1,s+5,s+5};
- //cout<<s[5]<<*p[4]<<**(p+4);
- //10
- //char *s[] = {"JLNEDYZEXA","8557424070","gqtwsqdco","FQEPCEQZF","654778267","jhfmoncj"};
- //int i=4, j=2;
- //cout<<s[i][j]<<*(*(s+i)+j)<<*((*s+i)+j);
- //
- // getchar();
- // return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement