#include<bits/stdc++.h>
#include<locale.h>
using namespace std;
int main()
{
double bal , sum=0,t,cse=0;
setlocale(LC_ALL, "en_US.UTF-8");
cin>>t;
while(t--){
for(int i=0; i<12; i++){
cin>>bal;
sum+=bal;
}
if((sum/12)>999.99)
printf("%.0lf $%ld,%.2lf\n",++cse,long(sum/12)/1000,fmod((sum/12.0),1000));
else{
printf("%.0lf $%.2lf\n",++cse,sum/12.0);
}
sum=0;
}
return 0;
}
#include<locale.h>
using namespace std;
int main()
{
double bal , sum=0,t,cse=0;
setlocale(LC_ALL, "en_US.UTF-8");
cin>>t;
while(t--){
for(int i=0; i<12; i++){
cin>>bal;
sum+=bal;
}
if((sum/12)>999.99)
printf("%.0lf $%ld,%.2lf\n",++cse,long(sum/12)/1000,fmod((sum/12.0),1000));
else{
printf("%.0lf $%.2lf\n",++cse,sum/12.0);
}
sum=0;
}
return 0;
}
No comments:
Post a Comment