Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*in the name of Allah */
- # include <list>
- # include <deque>
- # include <bitset>
- # include <algorithm>
- # include <functional>
- # include <numeric>
- # include <utility>
- # include <sstream>
- # include <iostream>
- # include <iomanip>
- # include <cstdio>
- # include <cmath>
- # include <cstdlib>
- # include <ctime>
- # include <set>
- # include <map>
- # include <cmath>
- # include <queue>
- # include <limits>
- # include <stack>
- # include <vector>
- # include <cstring>
- # include <cstdio>
- using namespace std;
- # define MEM(array,w) memset(array,w,sizeof array)
- # define fr(i,a,b) for(int (i) = a ; i < b ; i++)
- # define SET set<int>::iterator it = s.begin(); it != s.end();it++
- # define ULL unsigned long long
- # define eps 1e-9
- # define SS stringstream
- # define PR pair<int , int>
- # define all(c) (c).begin(), (c).end()
- # define maxint 1 << 31 - 1
- # define FOR(i, a, b) for (int i=a; i<b; i++)
- # define REP(i, a) FOR(i, 0, a)
- # define rive(s) reverse(s.begin(),s.end())
- # define OK(R,C) if(i>=0 && j>=0 && j<=C && i<=R)
- template<class T> string toString(T n){ostringstream ost;ost<<n;ost.flush();return ost.str();}
- int toInt(string s){int r=0;istringstream sin(s);sin>>r;return r;}
- bool isprime(int n){if( n<2) return 0;for( int i=2; i*i<=n ; i++)if(n%i==0)return 0; return 1;return 0;}
- int pel(string s){string t;t=s;reverse(t.begin(),t.end());if(s==t)return 1;return 0;}
- int main()
- {
- int n;
- cin>>n;
- int caset=0;
- while(n--)
- {
- long double sum=0.;
- for(int i=0;i<12;i++)
- {
- long double inp;
- cin>>inp;
- sum+=inp;
- }
- sum/=12;
- string s= toString(sum);
- string res="";
- rive(s);
- for(int i=0;i<s.size();i++)
- {
- res+=s[i];
- if(i>4 && i%3==2 && i!=s.size()-1)res+=",";
- }
- rive(res);
- printf("%d $",++caset);cout<<res<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement