【輸出%】poj 2350 Above Average
水題一道,但是學到的就是如何輸出百分號。。
直接printf(“%%”);即可。。。
AC的代碼:
#include <stdio.h> int a[1002]; int main() { int C; int N; scanf("%d",&C); int i; int sum; int count; while(C--) { sum=0; count=0; scanf("%d",&N); for(i=0;i<N;i++) { scanf("%d",&a[i]); sum+=a[i]; } for(i=0;i<N;i++) if (a[i]*N>sum) count++; //printf("count == %d\n",count); printf("%.3lf%%\n",(double)count/N*100); } return 0; }
最後更新:2017-04-03 05:39:56
上一篇:
[c#]分析器錯誤消息: 發現不明確的匹配。
下一篇:
智能家居項目(3):編譯工具makefile
1.3—Spring基礎配置—依賴注入
No marked region found along edge.Found along top edge.錯誤
在ASP.NET中使用Treeview控件和XML
java中short s=s+1和s+=1的區別
盤點中國第四次工業革命物聯網的數字亮點
PostgreSQL 數據庫NULL值的默認排序行為與查詢、索引定義規範 - nulls first\last, asc\desc
常見的排序算法
《Spring攻略(第2版)》——1.14 從Classpath中掃描組件
使用 Elizabeth 為應用生成隨機樣本數據
c:foreach遍曆和s:iterator遍曆異同