【问题标题】:Write functions that take a non empty array of doubles and its length as arguments and returns : [closed]编写将非空双精度数组及其长度作为参数并返回的函数:[关闭]
【发布时间】:2016-07-08 15:51:36
【问题描述】:

编写将非空双精度数组及其长度作为参数并返回的函数: a) 项目总和 b)最大值的索引 c) 一个布尔值,指示数字是否严格递增的顺序

【问题讨论】:

  • 你没有表现出任何努力并期望我们做你的工作?
  • 辛西娅,比恩维尼达堆栈溢出。 Aquí respondemos preguntas puntuales, y dudas técnicas。 Esto parece un ejercicio dado en clase。 Nos estás pidiendo que hagamos tu tarea! Para recibir ayuda en este sitio, te recomiendo primeo atacar el problema, y venir cuando tengas un impedimento puntual。 Que quede claro que lo intentaste, y que no estamos haciendo tu trabajo por vos :)
  • 我投票结束这个问题,因为 Stack Overflow 不是编码服务。

标签: c arrays function boolean structure


【解决方案1】:

线索1: 您可以返回一个内部包含 3 个变量的结构,如下所示:

struct Resu{
    double sum;
    int max;
    bool order;
};

线索 2:

Resu homework(double d[],int l){
..
.. your code must be here
..
}

线索 3:

Resu homework(double d[],int l){
     Resu result;
..
.. your magic must be here
..
    return result;
}

【讨论】:

  • @chux:已编辑...谢谢!
猜你喜欢
  • 1970-01-01
  • 2021-12-02
  • 2018-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-22
  • 1970-01-01
相关资源
最近更新 更多