Miyago147852

P1

Oct 13th, 2022
1,123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define endl "\n"
  3. #define endll "\n\n"
  4. #define pb push_back
  5. #define IO ios_base::sync_with_stdio(0)
  6. #define ll long long
  7. #define inf 0x3f3f3f3f
  8. #define MAXN inf
  9. #define MINN -inf
  10.  
  11. using namespace std;
  12.  
  13. class Solution{
  14.     public:
  15.  
  16.     private:
  17.    
  18. };
  19.  
  20. signed main(){
  21.     IO;
  22.     #ifdef DEBUG
  23.         cin.tie(0);cout.sync_with_stdio(0);
  24.         string rootPath = "./";
  25.          freopen((rootPath+"t.in").c_str(), "r", stdin);
  26.          freopen((rootPath+"t.out").c_str(), "w", stdout);
  27.     #endif
  28.  
  29.     // TODO
  30.  
  31.     int arr[3], sum = 0;
  32.     for (auto &i:arr) cin>>i, sum+=i;
  33.     sort(arr, arr+3);
  34.     printf("最大值:%d, 最小值:%d, 總和:%d, 平均值: %f\n", \
  35.         arr[2], arr[0], sum, sum/3.0);
  36.  
  37.     return EXIT_SUCCESS;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment