标签:pre nbsp int 语言 style code main can 考试
#include<stdio.h> int main() { int q[4]; int sum=0; int i; for(i=0;i<4;i++) { scanf("%d",&q[i]); sum=sum+q[i]; } char a[4]={‘A‘,‘B‘,‘C‘,‘D‘}; float percent[4]={(float)q[0]/sum,(float)q[1]/sum,(float)q[2]/sum,(float)q[3]/sum}; //printf("%.2f",percent[0]); for(i=0;i<4;i++) { if(q[i]>3) printf("%c:%.2f\n",a[i],percent[i]); } }
标签:pre nbsp int 语言 style code main can 考试
原文地址:https://www.cnblogs.com/yuhaowang/p/10226298.html