# Why did something go wrong and what should I do

2022-02-04 16:58:58

#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c,d;
while(scanf("%d%d %d%d",&a,&b,&c,&d) != EOF)
if(a=c,b=d)
printf("10000");
if(a=c,b=d)
printf("3000");
if(a!=d,b=c&&a=d,b!=c)
printf("1000");
if(a!=b,a!=d,b!=c,b!=d)
printf("none");
return 0;
}

``#include<stdio.h>#include<math.h>int main(){    int a,b,c,d;    while(scanf("%d%d %d%d",&a,&b,&c,&d) != EOF)    {        if(a==b && c==d)        {            printf("10000");            continue;        }        if(a==d && b==c)        {            printf("3000");            continue;        }        if(a == b || a == d || c == b || c == d)        {            printf("1000");            continue;        }        printf("none");    }    return 0;}``

``a=ba==b``

These are two different operators

First , You can only enter two numbers in one line
then , If the two conditions are met at the same time, use `&&` Connect , At least one satisfaction is used `||` Connect

a=c It's assignment , You want to a and c equal ,a==c

To judge equality ==
Logical combination &&
The code is modified as follows ：

``#include <stdio.h>int main(){    int a,b;    int a1,a2,b1,b2,t;    while(scanf("%d %d",&a,&b) != EOF)    {        a1 = a/10;        a2 = a%10;        b1 = b/10;        b2 = b%10;        if(a==b)            printf("10000\n");        else        {            if(a1 == b2 && a2 == b1)                printf("3000\n");            else if( (a1 == b1 && a2 != b2) || (a1==b2 && a2 != b1) )                printf("1000\n");            else                printf("0\n");        }    }    return 0;}``