Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int n = 81;
- int *p = &n;
- //////////////////////////////////////////////////////////////
- int main()
- {
- printf(" n = %d\n", n);
- printf("address n = %d\n", &n);
- printf("address n = %d\n", p);
- }
- /*
- #include <stdlib.h>
- #include <time.h>
- #include <iostream>
- using namespace std;
- void findMax(int);
- void findMin(int);
- int mas[20];// = { 1, 20, 23, 90, 890, 0, 78, 3179, 88, 367,
- // 11, 2,123, 19, 93,40, 79, 7, 8, -7 };
- //////////////////////////////////////////////////////////////
- int main()
- {
- cout << "Current time = " << time(0) << endl;
- cout << "sizeof int = " << sizeof(mas[4]) << endl;
- srand(time(0));
- for(int i = 0; i < 20; i++)
- {
- mas[i] = rand();
- cout << mas[i] << ", "<< endl;
- }
- findMax(20);
- findMin(20);
- }
- ///////////////////////////////////////////////
- void findMax(int n) //
- {
- int nMax = mas[0];
- for(int i = 1; i < n; i++)
- {
- if(nMax < mas[i] ) nMax = mas[i];
- }
- cout << "Max = " << nMax << endl;
- }
- ///////////////////////////////////////////////
- void findMin(int n) //
- {
- int nMin = mas[0];
- for(int i = 1; i < n; i++)
- {
- if(nMin > mas[i] ) nMin = mas[i];
- }
- cout << "munimun = " << nMin << endl;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement