Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
1
#include <stdio.h> int i=0; int a[], s[], d[], f[]; int w=0, e=0, t=0; int main(void) { srand ( time(NULL) ); printf("chislo komand\n"); scanf("%d", &i); for (int q=0; q<i; q++){ //printf("%d", q); a[q] = rand() %i; s[q] = rand() %i*1.5; d[q] = rand() %i*2; printf ("team %d: gold - %d silver - %d bronze -%d\n", q+1, a[q], s[q], d[q]); e=a[q]+s[q]+d[q]; //printf("team %d collect %d medals\n", q+1, e); if (w < e) w=e; t=q+1; } printf("best score %d medals - team %d", w, t); return 0; }
run
|
edit
|
history
|
help
0
json formatter
A_141205_CADENAS
asasas
22nd HW Switchv0.1
19_1
20171127_ARRAY_PRIMOS
150112_FuncionesOrdenArray
Lab 8 part 2 v.07
Max of arrays
Bitfield and Union in C - strange results