HackerEarth's basic programming solutions( Doctor's Secret, Goki and his breakup, I am Easy ) :
Problem 27: Doctor's Secret
Solution: (in c++)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
#include<bits/stdc++.h>
using namespace std;
int main()
{
int l,m;
cin>>l>>m;
if(l<=23 && ( m>=500 && m<=1000))
cout<<"Take Medicine"<<endl;
else
cout<<"Don't take Medicine"<<endl;
}
This code is simple. There's no need for any explanation.
Problem 28: Goki and his breakup
Solution: (in c++)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
#include<bits/stdc++.h>
using namespace std;
int main()
{
long n,x,y;
cin>>n>>x;
while(n--)
{
cin>>y;
if(y>=x)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
This code is simple. There's no need for any explanation.
Problem 29: I am Easy
Solution: (in c++)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i<=10;i++)
{
cout<<n*i<<endl;
}
}
This code is simple. There's no need for any explanation.
Guys , if you have any queries related to a question or need more explanation, comment down below!
thank you
ReplyDelete