Advertisement
mehedi1

4

Dec 24th, 2020
847
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include "bits/stdc++.h"
  2. using namespace std;
  3. #define ff first
  4. #define ss second
  5. #define pb push_back
  6. typedef long long ll;
  7. #define db(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<'\n'
  8. const int inf = 1e9+7;
  9. const int N = 1e6+9;
  10.  
  11. int main() {
  12.     ios_base::sync_with_stdio(0);
  13.     int A[5];
  14.     for(int i=0;i<4;++i) {
  15.         cin>>A[i];
  16.     }
  17.     sort(A, A+4);
  18.     int s=0;
  19.     for(int i=0;i<3;++i) s+=A[i];
  20.     if(s<=A[3]) cout<<"Invalid.";
  21.     else {
  22.         cout<<"valid";
  23.         int p=A[0], rhom=1;
  24.         for(int i=1;i<4;++i) {
  25.             if(A[i]!=p) rhom=0;
  26.         }
  27.         if(rhom) cout<<", rhombus";
  28.         else cout<<".";
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement