Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- void foo(int &);
- ////////////////////////////////////////////////////////////////////////
- int main() //
- {
- int massiv[20] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19 };
- // srand(time(0));
- for (int i = 0; i < 20; i++) massiv[i] = rand()%100;
- // int& ssilka = massiv[11];
- foo(massiv[11]);
- printf("\n\n\n");
- for (int i = 0; i < 20; i++)
- {
- printf("%d, ", massiv[i]);
- }
- }
- /////////////////////////////////////////////////////////////////////////
- void foo(int& count)
- {
- int* adress = &count;
- for (int i = 0; i < 20; i++)
- {
- printf("%d, ", adress[i - 11]);
- }
- }
- /*
- #include <stdio.h>
- int count1, count2, count3;
- char znak(int count1, int count2, int count3);
- //////////////////////////////////////////////////////////////////
- int main() //
- {
- int count = 0;
- scanf("%d", &count);
- for (int i = 0; i < count; i++)
- {
- scanf("%d%d%d", &count1, &count2, &count3);
- printf("%c\n", znak(count1, count2, count3));
- }
- }
- ////////////////////////////////////////////////////////////////
- char znak(int count1, int count2, int count3) //
- {
- if(count1 + count2 == count3) return('+');
- else if(count1 - count2 == count3) return('-');
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement