#include <stdio.h>
int x;
void mondai1(int b){
	x = b;
}
void mondai2(void){
	static int c =10;
	x =c;
	c++;
}
int mondai3(int d){
	x++;
	d++;
	return d;
}
int main(void) {
	printf("x = %d [GS: グローバル変数なので0で初期化]\n", x);
	x = 101;
	printf("x = %d [GS: 前行で101を代入した]\n", x);
    mondai1(102);
    printf("x = %d [GS: mondai1で102を代入した]\n", x);
	mondai2();
	mondai2();
	mondai2();
	printf("x = %d [GS: mondai2を3回呼び出し最後に12を代入した]\n", x);
	for (int i=103;i<104;i++){
		int x = i;
		printf("x = %d [LA: ローカル変数xをiの値103で初期化した]\n", x);
		x = mondai3(i);
		printf("x = %d [LA: mondai3が返した104を代入した]\n", x);
	}
	printf("x = %d [GS: mondai3のx++により12から13になった]\n", x);
	return 0;
}
	