#include int itix,itiy,mokuhyoux,mokuhyouy,ans,zans,zansx,zansy; int main(void) { //printf("今の座標と目標の座標教えて:"); scanf("%d %d %d %d",&itix,&itiy,&mokuhyoux,&mokuhyouy); if(itix == mokuhyoux || itiy == mokuhyouy){ ans=1; printf("%d",ans); return 0; } if(itix<0){ itix=itix*-1; } if(itiy<0){ itiy=itiy*-1; } if(mokuhyoux<0){ mokuhyoux=mokuhyoux*-1; } if(mokuhyouy<0){ mokuhyouy=mokuhyouy*-1; } zansx = mokuhyoux - itix; if(zansx<0){ zansx=zansx*-1; } zansy = mokuhyouy - itiy; if(zansy<0){ zansy=zansy*-1; } zans = zansx+zansy; if(zansx <= 2 && zansy <= 2 && zans<4){ ans = 1; printf("%d",ans); } else{ ans = 2; printf("%d",ans); } return 0; }