2022-03-09 07:57:33 +00:00
|
|
|
#include <stdio.h>
|
2022-03-09 08:39:43 +00:00
|
|
|
#include <stdlib.h>5
|
2022-03-09 07:57:33 +00:00
|
|
|
#define VELKOST_POLA 52
|
|
|
|
|
2022-03-09 07:58:54 +00:00
|
|
|
int main(){
|
2022-03-10 11:23:37 +00:00
|
|
|
/*int vysledky[VELKOST_POLA];
|
2022-03-09 08:26:32 +00:00
|
|
|
int pocet;
|
|
|
|
int max=0;
|
|
|
|
int i=0;
|
2022-03-10 11:23:37 +00:00
|
|
|
char pole[VELKOST_POLA];
|
2022-03-09 08:26:32 +00:00
|
|
|
memset(pole,0,VELKOST_POLA * sizeof(int));
|
2022-03-09 08:39:43 +00:00
|
|
|
for(i<vysledky; i++){
|
2022-03-09 08:26:32 +00:00
|
|
|
if (pole[i] > max){
|
|
|
|
max = pole[i];
|
|
|
|
}
|
2022-03-09 08:39:43 +00:00
|
|
|
printf("\nSúťažiaci č.%d vypil %d pohárov.\n", i , pole[i]);
|
2022-03-09 08:26:32 +00:00
|
|
|
}
|
2022-03-09 08:39:43 +00:00
|
|
|
printf("\nVýherca je súťažiaci%d ktorý vypil %d pohárov\n", c , max);
|
2022-03-09 07:57:33 +00:00
|
|
|
return 0;
|
2022-03-10 11:23:37 +00:00
|
|
|
*/
|
|
|
|
int n;
|
|
|
|
double arr[100];
|
|
|
|
printf("Enter the number of elements (1 to 100): ");
|
|
|
|
scanf("%d", &n);
|
|
|
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
printf("Enter number%d: ", i + 1);
|
|
|
|
scanf("%lf", &arr[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// storing the largest number to arr[0]
|
|
|
|
for (int i = 1; i < n; ++i) {
|
|
|
|
if (arr[0] < arr[i]) {
|
|
|
|
arr[0] = arr[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("Largest element = %.2lf", arr[0]);
|
|
|
|
|
|
|
|
return 0;
|
2022-03-05 16:27:11 +00:00
|
|
|
}
|