Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int a;
cin>>a;
int x, count = 0;
for(int i = 0; i < 3; i++){
cin>>x;
if(x > a){
count++;
}
}
cout<<count<<endl;
}
}
Copy The Code &
Try With Live Editor
Input
4
2 3 4 1
10000 0 1 2
500 600 400 300
0 9999 10000 9998
2 3 4 1
10000 0 1 2
500 600 400 300
0 9999 10000 9998
Output
2
0
1
3
0
1
3
Demonstration
Codeforcess Solution 1692-A A. Marathon ,C++, Java, Js and Python ,1692-A,Codeforcess Solution