Language: C

#include<stdio.h>
#include<windows.h>
void main(void){
	int H,W,o;int QWE;
	int HW[100][102];//農場データ
	int SoldFlag[100][102];//売約済みフラグ
	int Queue[100*102][2];
	int QueueStart=0,QueueEnd=1;
	int QueueNow=0;
	int Answer=0;
	int Count,CountH,CountW,CountQ,CountH2,CountW2;
	int MH,MW;
	for(CountH=0;CountH<100;CountH++){
		for(CountW=0;CountW<102;CountW++){
			SoldFlag[CountH][CountW]=0;
		}
	}
	for(CountH2=0;CountH2<10200;CountH2++){Queue[CountH2][0]=-1;Queue[CountH2][1]=-1;}//初期化
	//入力処理
	scanf("%d %d",&H,&W);
	for(Count=0;Count<H;Count++){
		scanf("%s",HW[Count]);
	}
	scanf("%s",&o);
	//ここまで
	for(CountH=0;CountH<H;CountH++){
		for(CountW=0;CountW<W;CountW++){
			if(SoldFlag[CountH][CountW]!=1){//始点が売約済みでないことを確認
				// 1
				//4 2
				// 3
				Queue[0][0]=CountH;//始点をセット
				Queue[0][1]=CountW;
				SoldFlag[CountH][CountW]=1;
				while(1){
					//printf("chk %d,%d,%d\n",QueueStart,QueueEnd,QueueNow);
					for(CountQ=QueueStart;CountQ<QueueEnd;CountQ++){
						if(Queue[CountQ][0]!=0){//Up
							if(SoldFlag[Queue[CountQ][0]-1][Queue[CountQ][1]]==0&&
								HW[Queue[CountQ][0]][Queue[CountQ][1]]==HW[Queue[CountQ][0]-1][Queue[CountQ][1]]){
								Queue[QueueEnd+QueueNow][0]=Queue[CountQ][0]-1;
								Queue[QueueEnd+QueueNow][1]=Queue[CountQ][1];
								SoldFlag[Queue[CountQ][0]-1][Queue[CountQ][1]]=1;
								QueueNow++;
								//printf("tui %d,%d,%d",QueueStart,QueueEnd,QueueNow);
							}
						}
						
						if(Queue[CountQ][1]<W-1){//Right
							if(SoldFlag[Queue[CountQ][0]][Queue[CountQ][1]+1]==0&&
								HW[Queue[CountQ][0]][Queue[CountQ][1]]==HW[Queue[CountQ][0]][Queue[CountQ][1]+1]){
								Queue[QueueEnd+QueueNow][0]=Queue[CountQ][0];
								Queue[QueueEnd+QueueNow][1]=Queue[CountQ][1]+1;
								SoldFlag[Queue[CountQ][0]][Queue[CountQ][1]+1]=1;
								QueueNow++;
								//printf("tui %d,%d,%d",QueueStart,QueueEnd,QueueNow);
							}
						}
						if(Queue[CountQ][0]<H-1){//Down
							if(SoldFlag[Queue[CountQ][0]+1][Queue[CountQ][1]]==0&&
								HW[Queue[CountQ][0]][Queue[CountQ][1]]==HW[Queue[CountQ][0]+1][Queue[CountQ][1]]){
								Queue[QueueEnd+QueueNow][0]=Queue[CountQ][0]+1;
								Queue[QueueEnd+QueueNow][1]=Queue[CountQ][1];
								SoldFlag[Queue[CountQ][0]+1][Queue[CountQ][1]]=1;
								QueueNow++;
								//printf("tui %d,%d,%d",QueueStart,QueueEnd,QueueNow);
							}
						}
						if(Queue[CountQ][1]!=0){//Left
							if(SoldFlag[Queue[CountQ][0]][Queue[CountQ][1]-1]==0&&
								HW[Queue[CountQ][0]][Queue[CountQ][1]]==HW[Queue[CountQ][0]][Queue[CountQ][1]-1]){
								Queue[QueueEnd+QueueNow][0]=Queue[CountQ][0];
								Queue[QueueEnd+QueueNow][1]=Queue[CountQ][1]-1;
								SoldFlag[Queue[CountQ][0]][Queue[CountQ][1]-1]=1;
								QueueNow++;
								//printf("tui %d,%d,%d",QueueStart,QueueEnd,QueueNow);
							}
						}
					}
					//printf("QN:%d\n",QueueNow);
					if(QueueNow==0){Answer++;QueueStart=0;QueueEnd=1;QueueNow=0;break;}
					QueueStart=QueueEnd;
					QueueEnd+=QueueNow;
					QueueNow=0;
				}
				//for(MH=0;MH<H;MH++){
				//	for(MW=0;MW<W;MW++){
				//		printf("%2d",SoldFlag[MH][MW]);
				//	}
				//	printf("\n");
				//}
				//for(QWE=0;QWE<10;QWE++){printf("%d,%d ",Queue[QWE][0],Queue[QWE][1]);}
				//system("pause");

			}
			for(CountH2=0;CountH2<10200;CountH2++){Queue[CountH2][0]=-1;Queue[CountH2][1]=-1;}//初期化
		}
	}
	printf("%d",Answer);


	
	
//	system("pause");
}

Compiler output:
main.c:2:9: fatal error: windows.h: No such file or directory
    2 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.