【问题标题】:how find a minimum in array C [closed]如何在数组 C 中找到最小值 [关闭]
【发布时间】:2022-12-10 12:14:39
【问题描述】:

//Enter the number N and a sequence A with N real numbers. Find and in the value value is smallest in the series. In the smallest value found, there is no carriage return at the end of the program``

\#include \<stdio.h\>
float n;
int i,a\[200\];
int main(){ 
printf("N = "); scanf("%f",&n);
for (i=0; i\<n; i++){
printf("a\[%d\] = ",i); scanf("%d",&a\[i\]);
}
int min = a\[0\];
for (i=1; i\<n; i++){
if (a\[i\]\<min)
min=a\[i\];

}   
printf("Gia tri nho nhat trong A: %g",min);

return 0;       

}

【问题讨论】:

  • 任务不是问题。

标签: c


【解决方案1】:

输入整数N,数列A有N个实数。明天请输出位置上的元素, 这些元素打印在 1 行上,以空格分隔

【讨论】:

    猜你喜欢
    • 2021-06-15
    • 2014-11-27
    • 2022-10-17
    • 2020-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-17
    相关资源
    最近更新 更多