prt ne valide pas mon code à cause du return , pouvez vous m’aider

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #207937 quote
    rubesh
    Participant
    New

    prt ne valide pas mon code à cause du return:

     

    #include <iostream>
    #include <vector>

    double movingAverage(const std::vector<double>& data, int period) {
    double sum = 0.0;
    for (int i = 0; i < period; i++) {
    sum += data[i];
    }
    double average = sum / period;
    return average;
    }

    int main() {
    std::vector<double> data = {1.0, 2.0, 3.0, 4.0, 5.0};
    int period = 3;
    std::cout << “Moyenne mobile : ” << movingAverage(data, period) << std::endl;
    return 0;
    }

    #207938 quote
    Nicolas
    Keymaster
    Master

    Ceci est du code C++, on ne programme pas dans ce langage avec ProRealTime. On utilise un code propriétaire appelé le ProBuilder ou le ProRealCode aussi désormais 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

prt ne valide pas mon code à cause du return , pouvez vous m’aider


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
rubesh @rubesh Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
3 years, 1 month ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 01/23/2023
Status: Active
Attachments: No files
Logo Logo
Loading...