#include <stdio.h>#include<iostream>using namespace std;int array1[] = {289, 432, 983, 498, 2003};int array2[] = {2, 4, 1, 8, 3};int temp, result = 0;int main(){for (temp = 0; temp < 5; temp++){result += array1[temp];}for (temp = 0; temp < 4; temp++){result += array2[temp];}cout << result;return 0;}
#include <iostream>#include <algorithm>#include <vector>using namespace std;int main (){int myints[] = { 1, 2, 3 ,4 };int * p;p = find (myints, myints + 4, 3);--p;cout << *p << '\n';return 0;}