Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/ #include <stdio.h> int main() { int a,b,c; scanf("%d%d%d", &a, &b, &c); if(a>b) { if(b>c) { if((b-c)<(a-b)) printf(":)\n"); else printf(":(\n"); } else printf(":)\n"); } else if(b>a) { if(c>b) { if((c-b)<(b-a)) printf(":(\n"); else printf(":)\n"); } else printf(":(\n"); } else if(c>b) printf(":)\n"); else printf(":(\n"); return 0; }
whats wrong with my code bro?
ReplyDelete#include
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a>b && c>=b){
cout<<":)"<a && c<=b){
cout<<":("<a && c>b && (b-a)>(c-b)){
cout<<":("<a && c>b && (b-a)<=(c-b)){
cout<<":)"<(b-c)){
cout<<":)"<b){
cout<<":)"<<endl;
}
else if (b==a && c<b){
cout<<":("<<endl;
}
return 0;
}
#include
ReplyDeleteusing namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a>b && c>=b){
cout<<":)"<a && c<=b){
cout<<":("<a && c>b && (b-a)>(c-b)){
cout<<":("<a && c>b && (b-a)<=(c-b)){
cout<<":)"<(b-c)){
cout<<":)"<b){
cout<<":)"<<endl;
}
else if (b==a && c<b){
cout<<":("<<endl;
}
return 0;
}
whats wrong with my code? sorry about the first comment.