Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <stdio.h>
- using namespace std;
- void masG(int* F,int *G,int N)
- {
- cout << "MAS G = ";
- for (int i = 0;i < N;i++)
- {
- if (F[i] %5 == 0)
- {
- G[i] = F[i];
- cout << G[i] << " ";
- }
- }
- }
- int main()
- {
- ifstream file("C:\\Users\\Irinda\\source\\repos\\Задание 1\\text.txt");
- if (!file)
- {
- cout << "File is not open";
- return -1;
- }
- else
- {
- cout << "File is open" << endl;
- const int N = 10;
- int F[N];
- int G[N];
- for (int i = 0;i < N;i++)
- {
- file >> F[i];
- cout << F[i] << " ";
- }
- cout << endl;
- masG(F, G, N);
- file.close();
- system("pause");
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement