-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4-84.cpp
More file actions
32 lines (23 loc) · 787 Bytes
/
Copy path4-84.cpp
File metadata and controls
32 lines (23 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/*
ÇÀÄÀÍÈÅ 4.38
*/
int main()
{
setlocale(0, "Russian");
srand((unsigned)time(NULL));
int array[] = {(rand() % 899 + 100), (rand() % 899 + 100), (rand() % 899 + 100), (rand() % 899 + 100) };
int summ = 0;
cout << "Äàíû ÷èñëà: " << array[0] << " | " << array[1] << " | " << array[2] << " | " << array[3] << endl;
if (!(array[0] % 3)) summ += array[0]; cout << array[0] % 3 << endl;
if (!(array[1] % 3)) summ += array[1]; cout << array[1] % 3 << endl;
if (!(array[2] % 3)) summ += array[2]; cout << array[2] % 3 << endl;
if (!(array[3] % 3)) summ += array[3]; cout << array[3] % 3 << endl;
cout << summ << endl;
system("pause");
return 0;
}