Загрузка...

How to solve the problem?

Thread in C/C++ created by xopen Dec 24, 2020. 159 views

  1. xopen
    xopen Topic starter Dec 24, 2020 ;) 1527 Oct 30, 2019
    Дано линейный массив целых чисел. Проверьте, есть ли он упорядоченным по убыванию.
     
  2. JacqueFresco
    JacqueFresco Dec 24, 2020 Хоба 1463 Feb 20, 2020
    C
    #include <iostream>
    #include <conio.h>
    #include <string>
    using namespace std;

    int main(){
    const int count = 10;
    int mas[count] = {10,9,8,7,6,5,4,3,2,1}; //Массив
    string fintext;
    for(int i = 1; i < count; i++){
    fintext = mas[i-1] == mas[i]+1 ? "Massiv po ubivaniu!" : "Massiv ne po ubivaniu"; //Проверка
    cout << fintext<< endl;
    }
    _getch();
    }
    The post was merged to previous Dec 24, 2020
    это с++
     
    1. xopen Topic starter
Top
Loading...