Untitled
kkkkunknown
c_cpp
a year ago
688 B
3
Indexable
#include <stdio.h> #include <math.h> #include <string.h> #include <math.h> #include <ctype.h> #include <stdlib.h> struct pok{ char ten[100]; int con; int tongda; int socon,tongthat; }; typedef struct pok pok; int main() { int n; scanf("%d",&n); pok a[n]; int max=0,m=0; for(int i=0;i<n;i++) { getchar(); gets(a[i].ten); scanf("%d %d",&a[i].con, &a[i].tongda); a[i].tongthat= (int) a[i].tongda + (a[i].tongda / a[i].con)*2; a[i].socon = (int)a[i].tongthat / a[i].con; m+=a[i].socon; if(a[i].socon>max) { max=a[i].socon; } } for(int i=0;i<n;i++) { if(a[i].socon== max) { printf("%d\n%s\n",m,a[i].ten); } } }
Editor is loading...
Leave a Comment