• Написать программу на с++. Помогите. Заранее спасибо!

    question img

Ответы 5

  • #include <fstream>#include <iostream>#include <cmath>using namespace std;int main(){ int N; int array[10]; ifstream cin("input.txt"); ofstream cout("output.txt"); cin >> N; for(int i = 0;i < N;i++) { cin >> array[i]; if(i % 2 == 0) cout << array[i] << " "; } return 0;}
    • Автор:

      kittyqjpu
    • 6 лет назад
    • 0
  • В этом решении нужно что-то доработать , в программе оно не работает
  • Сейчас исправлю
    • Автор:

      melody91
    • 6 лет назад
    • 0
  • работает?
  • #include <fstream>#include <iostream>using namespace std;int main(){    int N;    int array[100];    ifstream file1 ("input.txt");    ofstream file2 ("output.txt");    file1 >> N;    for(int i = 0;i < N;i++)  {        file1 >> array[i];        if(i % 2 == 0)            file2 << array[i] << " ";    }    return 0;}
    • Автор:

      cindyspjy
    • 6 лет назад
    • 0
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years