Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Cvičenie -č.5-UDP
//clang 6.0.0 #include <stdio.h> int u = 0; int w = 0; int r = 0; int main(void) { /*printf("Zadajte prve cislo:\n"); scanf("%d", &u); printf("Zadajte druhe cislo:\n"); scanf("%d", &w); while(w != 0) { r = u % w; u = w; w = r; } printf("Najvacsi spolovncy delitel = %d\n", u); */ //N = pocet #define pocet 5 #define MIN -3.0 #define MAX 800.0 double data[pocet]; double minimum = MAX; double maximum = MIN; int i = 0; while(i<pocet) { scanf("%lf", &data[i]); if((data[i] < MIN)) { printf("Zadane cislo: %lf je mimo povoleny rozsah!\n", data[i]); data[i] = MIN; } else if((data[i] > MAX)) { printf("Zadane cislo: %lf je mimo povoleny rozsah!\n", data[i]); data[i] = MAX; } if(data[i] >= maximum) { maximum = data[i]; } if(data[i] <= minimum) { minimum = data[i]; } i++; } printf("Max: %lf\n", maximum); printf("Min: %lf\n", minimum); return 0; }
run
|
edit
|
history
|
help
0
lab7
Recursividad: Hanoi
Es un rectangulo
resize.c
Herout (67) - 13
0002
Herout (67) - 12
Herout (67) - 15
Sin(x) in C Teylor
salida