anonymous No title
C
Can You Snort Cephalexin 500mg https://newfasttadalafil.com/ - Cialis Xrtmtf Xrwrtr <a href=https://newfasttadalafil.com/>Cialis</a> Discount Generic Provera With Free Shipping Real Cujryz Hydrochlorothiazide Mastercard Discount No Script Needed https://newfasttadalafil.com/ - is generic cialis available
anonymous No title
C
#include"DxLib.h"


int st2std[10],st2stdl[10],st2wk2[12],st2wk2l[12];
//移動の際使う
int x, y;
//iとmでアニメーションの周期速度調整
int  i = 0, m = 0,P=0,Q=0;
//向き muki>=0右 muki<0左
int muki;
//初期位置
int shokix = 50, shokiy = 320;
//当判定    左上xy,右下xy
int at[4] = {17,18,42,45};
int AT[4];
//重力
int GPOWER;
//自機画像左上のポイント
int Yzah, Xzah;
//接地している場合0 していない場合1 ※考え中
int setti=0;



int st[];

void st2stdrv();
void st2stdlv();
void st2wk2rv();
void st2wk2lv();
void zahyou();
void jump();
void gravity();
void stage0();
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen(DX_SCREEN_BACK);
	

	//右向き
	muki = 0;
	//↓画像10分割,横5分割,縦2分割,一つの横サイズ63,一つの縦サイズ48,代入する変数
	LoadDivGraph("画像/style2-stand.png",10,5,2,63,48,st2std);
	LoadDivGraph("画像/style2-standl.png", 10, 5, 2, 63, 48, st2stdl);
	LoadDivGraph("画像/st2-walk2.png", 12, 6, 2, 63, 48, st2wk2);
	LoadDivGraph("画像/st2-walk2l.png", 12, 6, 2, 63, 48, st2wk2l);
	while (ScreenFlip() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0 && ProcessMessage() == 0 && ClearDrawScreen() == 0) {
		
		Xzah = x + shokix;
		Yzah = y + shokiy;

		if (CheckHitKey(KEY_INPUT_0))zahyou();
		

		if(muki>=0)st2stdrv();
		if (muki < 0)st2stdlv();
		// ボックスの左上[移動先(x)+初期位置(50)+当たり判定X座標左上(17)]                                   FALSE= 塗りつぶしなし
	
		if (CheckHitKey(KEY_INPUT_RIGHT))st2wk2rv();
		if (CheckHitKey(KEY_INPUT_LEFT))st2wk2lv();
		//if (CheckHitKey(KEY_INPUT_UP))y=y--;
		//if (CheckHitKey(KEY_INPUT_DOWN))y=y++;
		//ジャンプ上昇
		if (CheckHitKey(KEY_INPUT_SPACE))jump();
		//ジャンプからボタンを離すとゆるやかに数字が下降
		if (CheckHitKey(KEY_INPUT_SPACE) == 0)Q--, gravity();
		//Qがマイナスにならないよう処理
		if (Q < 0)Q = 0;
		//座標表示
		if (CheckHitKey(KEY_INPUT_Q))zahyou();

		
		stage0();
		

		DrawFormatString(10, 25, GetColor(255, 255, 255), "Q=%d", Q);
		DrawFormatString(10, 65, GetColor(255, 255, 255), "Y座標=%d", Yzah);
		DrawFormatString(10, 80, GetColor(255, 255, 255), "X座標=%d", Xzah);
		DrawFormatString(10, 115, GetColor(255, 255, 255), "GPOWER=%d", GPOWER);

		DrawFormatString(10, 150, GetColor(255, 255, 255), "at[0]=%d", at[0]);
		DrawFormatString(10, 165, GetColor(255, 255, 255), "y=%d", y);
		DrawFormatString(10, 200, GetColor(255, 255, 255), "x=%d", x);
		DrawFormatString(10, 215, GetColor(255, 255, 255), "shokiy=%d", shokiy);
		DrawFormatString(10, 230, GetColor(255, 255, 255), "shokix=%d", shokix);

		

	}
	DxLib_End();
	return 0;
}
void st2stdrv() {
	//立ち状態右向き
	DrawFormatString(100, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2std[i], TRUE);
	
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	//自機の白い四角
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	//自機の足元ピンク
	DrawLine(x + shokix + at[0], y + shokiy + at[3], x + shokix + at[2] , y + shokiy + at[3], GetColor(255, 0, 255));
	
}
void st2stdlv() {
	//立状態左向き
	DrawFormatString(70, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2stdl[i], TRUE);
	

	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void st2wk2rv() {
	//右歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2[i], TRUE);
	x = x + 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	if(m==1)PlaySound("foot_SE.mp3", DX_PLAYTYPE_NORMAL);
}
void st2wk2lv() {
	//左歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2l[i], TRUE);
	x = x = x - 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = -1;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void zahyou()
{
	//x座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i % 50 == 0)
		{
			DrawLine(i, 0, i, 10, GetColor(255, 255, 255));
			DrawFormatString(i, 10, GetColor(255, 255, 255), "%d", i);
		}
	}
	//y座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i > 0)
			if (i % 50 == 0)
			{
				DrawLine(0, i, 10, i, GetColor(255, 255, 255));
				DrawFormatString(10, i, GetColor(255, 255, 255), "%d", i);
			}
	}
	//縦線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q, i - 5, Q, i + 5, GetColor(255, 255, 255));
			}
		}
	}
	//横線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q - 5, i, Q + 5, i, GetColor(255, 255, 255));
			}
		}
	}
}
void jump()
{

	Q++;
	if (Q >= 33)Q=33;
		
	if (Q == 1)y = y - 10;
	if (Q == 2)y = y - 9;
	if (Q == 3)y = y - 9;
	if (Q == 4)y = y - 7;
	if (Q == 5)y = y - 7;
	if (Q == 6)y = y - 7;
	if (Q == 7)y = y - 6;
	if (Q == 8)y = y - 6;
	if (Q == 9)y = y - 6;
	if (Q == 10)y = y - 6;
	if (Q == 11)y = y - 5;
	if (Q == 12)y = y - 5;
	if (Q == 13)y = y - 5;
	if (Q == 14)y = y - 5;
	if (Q == 15)y = y - 5;
	if (Q == 16)y = y - 4;
	if (Q == 17)y = y - 4;
	if (Q == 18)y = y - 4;
	if (Q == 19)y = y - 4;
	if (Q == 20)y = y - 3;
	if (Q == 21)y = y - 3;
	if (Q == 22)y = y - 2;
	if (Q == 23)y = y - 2;
	if (Q == 24)y = y - 2;
	if (Q == 25)y = y - 2;
	if (Q == 26)y = y - 2;
	if (Q == 27)y = y - 2;
	if (Q == 28)y = y - 1;
	if (Q == 29)y = y - 1;
	if (Q == 30)y = y - 1;
	if (Q == 31)y = y - 1;
	if (Q == 32)y = y - 1;

		/*
		
		if (Q == 1)y = y - 8;
		if (Q == 2)y = y - 7;
		if (Q == 3)y = y - 7;
		if (Q == 4)y = y - 6;
		if (Q == 5)y = y - 6;
		if (Q == 6)y = y - 6;
		if (Q == 7)y = y - 5;
		if (Q == 8)y = y - 5;
		if (Q == 9)y = y - 5;
		if (Q == 10)y = y - 5;
		if (Q == 11)y = y - 4;
		if (Q == 12)y = y - 4;
		if (Q == 13)y = y - 4;
		if (Q == 14)y = y - 4;
		if (Q == 15)y = y - 4;
		if (Q == 16)y = y - 3;
		if (Q == 17)y = y - 3;
		if (Q == 18)y = y - 3;
		if (Q == 19)y = y - 3;
		if (Q == 20)y = y - 3;
		if (Q == 21)y = y - 3;
		if (Q == 22)y = y - 2;
		if (Q == 23)y = y - 2;
		if (Q == 24)y = y - 2;
		if (Q == 25)y = y - 2;
		if (Q == 26)y = y - 2;
		if (Q == 27)y = y - 2;
		if (Q == 28)y = y - 1;
		if (Q == 29)y = y - 1;
		if (Q == 30)y = y - 1;
		if (Q == 31)y = y - 1;
		if (Q == 32)y = y - 1;
		*/
}
void gravity()
{
	GPOWER = (33 - Q)/3;
	y = y + GPOWER;
	if (Yzah >= 450)y=y - 450;
	if (CheckHitKey(KEY_INPUT_P))y = y - GPOWER;


}
void stage0()
{
	int AT[4] = { x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3] };
	



	DrawFormatString(10, 130, GetColor(255, 255, 255), "AT[0]=%d", AT[0]);
	DrawFormatString(100, 130, GetColor(255, 255, 255), "AT[1]=%d", AT[1]);
	DrawFormatString(190, 130, GetColor(255, 255, 255), "AT[2]=%d", AT[2]);
	DrawFormatString(280, 130, GetColor(255, 255, 255), "AT[3]=%d", AT[3]);



	//       ここから ここまで
	DrawLine(60, 420, 120,420, GetColor(255, 255, 255));

	if (((60 <= AT[0] && AT[0] <= 120) || (60 <= AT[2] && AT[2] <= 120)) && (420<=AT[3]&&AT[3]<=430))y = y-GPOWER;


}
てあれった No title
C
#include"DxLib.h"


int st2std[10],st2stdl[10],st2wk2[12],st2wk2l[12];
//移動の際使う
int x, y;
//iとmでアニメーションの周期速度調整
int  i = 0, m = 0,P=0,Q=0;
//向き muki>=0右 muki<0左
int muki;
//初期位置
int shokix = 50, shokiy = 320;
//当判定    左上xy,右下xy
int at[4] = {17,18,42,45};
int AT[4];
//重力
int GPOWER;
//自機画像左上のポイント
int Yzah, Xzah;
//接地している場合0 していない場合1 ※考え中
int setti=0;



int st[];

void st2stdrv();
void st2stdlv();
void st2wk2rv();
void st2wk2lv();
void zahyou();
void jump();
void gravity();
void stage0();
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen(DX_SCREEN_BACK);
	

	//右向き
	muki = 0;
	//↓画像10分割,横5分割,縦2分割,一つの横サイズ63,一つの縦サイズ48,代入する変数
	LoadDivGraph("画像/style2-stand.png",10,5,2,63,48,st2std);
	LoadDivGraph("画像/style2-standl.png", 10, 5, 2, 63, 48, st2stdl);
	LoadDivGraph("画像/st2-walk2.png", 12, 6, 2, 63, 48, st2wk2);
	LoadDivGraph("画像/st2-walk2l.png", 12, 6, 2, 63, 48, st2wk2l);
	while (ScreenFlip() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0 && ProcessMessage() == 0 && ClearDrawScreen() == 0) {
		
		Xzah = x + shokix;
		Yzah = y + shokiy;

		if (CheckHitKey(KEY_INPUT_0))zahyou();
		

		if(muki>=0)st2stdrv();
		if (muki < 0)st2stdlv();
		// ボックスの左上[移動先(x)+初期位置(50)+当たり判定X座標左上(17)]                                   FALSE= 塗りつぶしなし
	
		if (CheckHitKey(KEY_INPUT_RIGHT))st2wk2rv();
		if (CheckHitKey(KEY_INPUT_LEFT))st2wk2lv();
		//if (CheckHitKey(KEY_INPUT_UP))y=y--;
		//if (CheckHitKey(KEY_INPUT_DOWN))y=y++;
		//ジャンプ上昇
		if (CheckHitKey(KEY_INPUT_SPACE))jump();
		//ジャンプからボタンを離すとゆるやかに数字が下降
		if (CheckHitKey(KEY_INPUT_SPACE) == 0)Q--, gravity();
		//Qがマイナスにならないよう処理
		if (Q < 0)Q = 0;
		//座標表示
		if (CheckHitKey(KEY_INPUT_Q))zahyou();

		
		stage0();
		

		DrawFormatString(10, 25, GetColor(255, 255, 255), "Q=%d", Q);
		DrawFormatString(10, 65, GetColor(255, 255, 255), "Y座標=%d", Yzah);
		DrawFormatString(10, 80, GetColor(255, 255, 255), "X座標=%d", Xzah);
		DrawFormatString(10, 115, GetColor(255, 255, 255), "GPOWER=%d", GPOWER);

		DrawFormatString(10, 150, GetColor(255, 255, 255), "at[0]=%d", at[0]);
		DrawFormatString(10, 165, GetColor(255, 255, 255), "y=%d", y);
		DrawFormatString(10, 200, GetColor(255, 255, 255), "x=%d", x);
		DrawFormatString(10, 215, GetColor(255, 255, 255), "shokiy=%d", shokiy);
		DrawFormatString(10, 230, GetColor(255, 255, 255), "shokix=%d", shokix);

		

	}
	DxLib_End();
	return 0;
}
void st2stdrv() {
	//立ち状態右向き
	DrawFormatString(100, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2std[i], TRUE);
	
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	//自機の白い四角
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	//自機の足元ピンク
	DrawLine(x + shokix + at[0], y + shokiy + at[3], x + shokix + at[2] , y + shokiy + at[3], GetColor(255, 0, 255));
	
}
void st2stdlv() {
	//立状態左向き
	DrawFormatString(70, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2stdl[i], TRUE);
	

	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void st2wk2rv() {
	//右歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2[i], TRUE);
	x = x + 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	if(m==1)PlaySound("foot_SE.mp3", DX_PLAYTYPE_NORMAL);
}
void st2wk2lv() {
	//左歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2l[i], TRUE);
	x = x = x - 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = -1;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void zahyou()
{
	//x座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i % 50 == 0)
		{
			DrawLine(i, 0, i, 10, GetColor(255, 255, 255));
			DrawFormatString(i, 10, GetColor(255, 255, 255), "%d", i);
		}
	}
	//y座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i > 0)
			if (i % 50 == 0)
			{
				DrawLine(0, i, 10, i, GetColor(255, 255, 255));
				DrawFormatString(10, i, GetColor(255, 255, 255), "%d", i);
			}
	}
	//縦線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q, i - 5, Q, i + 5, GetColor(255, 255, 255));
			}
		}
	}
	//横線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q - 5, i, Q + 5, i, GetColor(255, 255, 255));
			}
		}
	}
}
void jump()
{

	Q++;
	if (Q >= 33)Q=33;
		
	if (Q == 1)y = y - 10;
	if (Q == 2)y = y - 9;
	if (Q == 3)y = y - 9;
	if (Q == 4)y = y - 7;
	if (Q == 5)y = y - 7;
	if (Q == 6)y = y - 7;
	if (Q == 7)y = y - 6;
	if (Q == 8)y = y - 6;
	if (Q == 9)y = y - 6;
	if (Q == 10)y = y - 6;
	if (Q == 11)y = y - 5;
	if (Q == 12)y = y - 5;
	if (Q == 13)y = y - 5;
	if (Q == 14)y = y - 5;
	if (Q == 15)y = y - 5;
	if (Q == 16)y = y - 4;
	if (Q == 17)y = y - 4;
	if (Q == 18)y = y - 4;
	if (Q == 19)y = y - 4;
	if (Q == 20)y = y - 3;
	if (Q == 21)y = y - 3;
	if (Q == 22)y = y - 2;
	if (Q == 23)y = y - 2;
	if (Q == 24)y = y - 2;
	if (Q == 25)y = y - 2;
	if (Q == 26)y = y - 2;
	if (Q == 27)y = y - 2;
	if (Q == 28)y = y - 1;
	if (Q == 29)y = y - 1;
	if (Q == 30)y = y - 1;
	if (Q == 31)y = y - 1;
	if (Q == 32)y = y - 1;

		/*
		
		if (Q == 1)y = y - 8;
		if (Q == 2)y = y - 7;
		if (Q == 3)y = y - 7;
		if (Q == 4)y = y - 6;
		if (Q == 5)y = y - 6;
		if (Q == 6)y = y - 6;
		if (Q == 7)y = y - 5;
		if (Q == 8)y = y - 5;
		if (Q == 9)y = y - 5;
		if (Q == 10)y = y - 5;
		if (Q == 11)y = y - 4;
		if (Q == 12)y = y - 4;
		if (Q == 13)y = y - 4;
		if (Q == 14)y = y - 4;
		if (Q == 15)y = y - 4;
		if (Q == 16)y = y - 3;
		if (Q == 17)y = y - 3;
		if (Q == 18)y = y - 3;
		if (Q == 19)y = y - 3;
		if (Q == 20)y = y - 3;
		if (Q == 21)y = y - 3;
		if (Q == 22)y = y - 2;
		if (Q == 23)y = y - 2;
		if (Q == 24)y = y - 2;
		if (Q == 25)y = y - 2;
		if (Q == 26)y = y - 2;
		if (Q == 27)y = y - 2;
		if (Q == 28)y = y - 1;
		if (Q == 29)y = y - 1;
		if (Q == 30)y = y - 1;
		if (Q == 31)y = y - 1;
		if (Q == 32)y = y - 1;
		*/
}
void gravity()
{
	GPOWER = (33 - Q)/3;
	y = y + GPOWER;
	if (Yzah >= 450)y=y - 450;
	if (CheckHitKey(KEY_INPUT_P))y = y - GPOWER;


}
void stage0()
{
	int AT[4] = { x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3] };
	



	DrawFormatString(10, 130, GetColor(255, 255, 255), "AT[0]=%d", AT[0]);
	DrawFormatString(100, 130, GetColor(255, 255, 255), "AT[1]=%d", AT[1]);
	DrawFormatString(190, 130, GetColor(255, 255, 255), "AT[2]=%d", AT[2]);
	DrawFormatString(280, 130, GetColor(255, 255, 255), "AT[3]=%d", AT[3]);



	//       ここから ここまで
	DrawLine(60, 420, 120,420, GetColor(255, 255, 255));

	if (((60 <= AT[0] && AT[0] <= 120) || (60 <= AT[2] && AT[2] <= 120)) && (420<=AT[3]&&AT[3]<=430))y = y-GPOWER;


}

フェアリーテイル56~ kadai1
C
#include <stdio.h>
#define NUMBER 5
#define FAILED -1
int search(int vc[], int key, int no){
    int i = 0;
    vc[no] = key;
    while(1){
        if(vc[i]==key){
            break;
        }
        i++;
    }
    return(i==no ? FAILED : i);
}

int main(void){
    int i,key,index;
    int vx[NUMBER+1];
    for (int i=0; i<NUMBER; i++) {
        printf("vx[%d]: ", i);
        scanf("%d", &vx[i]);
    }
    printf("探す値:");
    scanf("%d", &key);

    index = search(vx, key, NUMBER);
    
    if(index==FAILED){
        printf("探索失敗");
    }
    else {
        printf("%d is in %d\n", key, index);
    }
    return 0;
}
anonymous No title
C
#include <stdio.h>

int a[11] = {6, 7, 11, 12, 14, 18, 19, 21, 24, 28, 37};
int main(void){
    int key = 11;
    int l = -1;
    int r = sizeof(a)/sizeof(int);
    while (r-l > 1) {
        int m = l + (r - l)/2;
        if (a[m] > key) {
            r = m;
        }
        else {
            l = m;
        }
    }
    printf("%d", r);
    return 0;
}
フェアリーテイル56~ No title
C
#include <stdio.h>
#include <stdlib.h>
int main(void){
    unsigned char header[0x36];
    unsigned char color_parett[0x435-0x36];
    unsigned char **data;
    unsigned char *temp_data;
    char in_f_name[20] = "./LENNA.bmp", out_f_name[20] = "./output_copy.bmp";
    FILE *in_f, *out_f;
    long start_addr, end_addr;
    int width, height, color_bit;
    int i, j, k;
    if ((in_f=fopen(in_f_name, "rb"))==NULL){
        printf("Error on open file.\n");
    }

    /* header */
    for (int i=0; i<0x36; i++){
        header[i] = fgetc(in_f);
        // printf("%x: %x\n", i, header[i]);
    }
    start_addr = header[0x0A] + header[0x0B] * 0x100;
    end_addr = header[0x02] + header[0x03]*0x100 + header[0x04]*0x10000 + header[0x05]*0x1000000;
    width = header[0x12] + header[0x13] * 0x100;
    height = header[0x16] + header[0x17] * 0x100;
    color_bit = header[0x1C];
    printf("data_addr: 0x%x to 0x%x\n", start_addr, end_addr);
    printf("width: %d\n", width);
    printf("height: %d\n", height);
    printf("color: %xbit\n", color_bit);

    /* color parett*/
    for (int i=0x36; i<start_addr; i++){
        color_parett[i-0x36] = fgetc(in_f);
    }

    /* data */
    data = (char **)malloc(sizeof(char *) * height);
    for(i=0; i<height; i++){
        data[i] = (char *) malloc(sizeof(char)*width);
    }

    temp_data = (char *) malloc(sizeof(char)*height*width);

    // 1D data for 2D data
    temp_data = (char *)malloc(sizeof(char) * (end_addr - start_addr));
    for(i=start_addr; i<end_addr; i++){
        temp_data[i-start_addr] = fgetc(in_f);
    }
    /* convert to 2D data*/

    /*data output*/
    for (int i = 0; i < 0x36; i++)
    {
        printf("%x, ", header[i]);
    }
    for (int i = 0x36; i < start_addr; i++)
    {
        // printf("%x", color_parett[i]);
    }
    for (i = 0; i < end_addr - start_addr; i++)
    {
        // printf("%x", temp_data[i]);
    }

    /* writing */
    if ((out_f = fopen(out_f_name, "wb")) == NULL){
        printf("Error on open file.\n");
    }
    fprintf(out_f, "%c", 0x42);
    for (i = 1; i < 0x36; i++){
        fprintf(out_f, "%c", header[i]);
    }
    for (i = 0; i < 0x435-0x36; i++){
        fprintf(out_f, "%c", color_parett[i]);
    }
    for (i = 0; i < end_addr - start_addr; i++){
        fprintf(out_f, "%c", temp_data[i]);
    }
    fclose(out_f);

    free(temp_data);
    free(data);

}
anonymous No title
C
#include <stdio.h>
#include <stdlib.h>
#include<string.h>

 struct CELL{
    struct CELL *prev;
    int value;
    struct CELL *next;
};
struct CELL *insertCellPrev(struct CELL*, int);

struct CELL head;

struct CELL *appendCell(int data){
    struct CELL *p;
    int x=data;
    p=insertCellPrev(&head , x);
    return p;
}
struct CELL *insertCellPrev(struct CELL *p , int data){
    struct CELL *x;
    if(p==NULL){
        printf("insert : 引数が正しくありません\n");
        return NULL;
    }
    x=(struct CELL*)malloc(sizeof(struct CELL));
    if(x==NULL){
        printf("not enough memory\n");
        return NULL;
    }
    x->value=data;
    x->next=p;
    x->prev=p->prev;
    p->prev->next=x;
    p->prev=x;
    return x;
}

void printDlist(struct CELL *q){
    struct CELL *p;
    printf("LIST[");
    for(p=q; p!=&head ; p=p->next){
        printf(" %d ", p->value);
    }
    printf("]\n");

}
int deleteDuplicatedCell(int data){
    struct CELL *p;
    int num=0;
    for(p=head.next ; p!=&head ; p=p->next){
        if(p->value==data){
            num++;
            p->prev->next=p->next;
            p->next->prev=p->prev;
            free(p);
        }
    }
    if(num==0){
        return -1;
    }else{
        return num;
    }
}
void freeDlist(){
    struct CELL *p;
    int x=0;
    p=&head;
    for(p=head.next ; p->prev=&head ; p=p->next){
        printDlist(p);
        p->prev->next=p->next;
        p->next->prev=p->prev;
        free(p);
    }
}
void main(int argc , char *argv[]){
    struct CELL *p;
    int num;
    int n;
    head.prev = head.next = &head;

    for(int i=1 ; i<argc ; i++){
       p=appendCell(atoi(argv[i]));
    }
    printDlist(head.next);

while(1){
    printf("Delete Data : "); scanf("%d", &num);
    if(num<0){
        printf("free list\n");
        freeDlist();
        exit(0);
    }
    n=deleteDuplicatedCell(num);
    if(n!=-1){
        printf("Deleted : %d\n", n);
    }else if(n==-1){
        printf("Not deleted .....\n");
    }
    printDlist(head.next);
}

    return ;
}
anonymous No title
C
#include <stdio.h>

int main(void)
{
    printf("Hello World!");
    return 0;
}
anonymous No title
C
#include〈stdio.h〉
 int main(void)
 {
   int n;
      while(true){
         printf(“%d¥n”,n);
n = n + 1;
      }
     return 0;
  }
anonymous No title
C
#include〈stdio.h〉
 int main(void)
 {
   int n;
     for(n=0;n<10;n++){
         printf(“%d¥n”,n);
      }
     return 0;
  }
Don't you submit code?
Submit