#include <iostream> #include <cmath> using namespace std; float jishu(float a){ if(a<1){ return 0.0; } if(a<=70){ return 0.1; } float x=a/70; return ceil(x)*0.1; } int main(int argc, char** argv) { int n; cin>>n; int js; float sum=0; for(int i=0;i<n;i++){ cin>>js; sum=sum+jishu(js); } printf("%.1f",sum); return 0; }
标签:短信,int,sum,float,jishu,js,计费,include From: https://www.cnblogs.com/hanxuyao/p/17090140.html