This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <ctype.h> | |
#include <string.h> | |
int main(int argc, char*argv[]) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
int main(){ | |
int i=1234; | |
char* ch = (char*)&i; | |
printf("*ch=%d\n", *ch); | |
printf("*(ch+1)=%d\n", *(ch+1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <ctype.h> | |
#include <string.h> | |
void printIterative(int upbound) | |
{ | |
int i; | |
for(i=0;i<=upbound;i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//輸出cost | |
double getTypeACost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS); | |
double getTypeBCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS); | |
double getTypeCCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS); | |
double getTypeDCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS); | |
double getTypeECost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS); | |
//輸出真正花費(cost低於資費時,還是得花資費的錢) | |
double getTypeARealCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS); | |
double getTypeBRealCost(double I-nc, double E-nc, double lc, int I-n SMS, int E-n SMS); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf("想吃蛋糕嗎?); | |
int input; | |
scanf("%d", &input); | |
if(input==1){ | |
getItem("Cake", 5); | |
}else{ | |
printf("敬酒不吃 罰酒"); | |
battle(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
變量操作 battleTime = 0; | |
循環 | |
戰鬥處理 slime*2 | |
如果 便量battleTime==1 | |
顯示文字 打文一場戰鬥還剩下四場 | |
否則 | |
如果便量 battleTime==2 | |
打完二場戰鬥!還剩下三場 | |
否則 | |
如果便量 battleTime==3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int battle=0; | |
for(battle=1;battle<=5;battle++) | |
{ | |
battle(slime, 2); | |
switch(battle) | |
{ | |
case 1:printf("打完一場戰鬥還剩下4場\n");break; | |
case 2:printf("打完一場戰鬥還剩下3場\n");break; | |
case 3:printf("ㄚㄚ#\n");break; | |
case 4:printf("4\n");break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int battleTime=0,slime=2,cake; | |
for(;;) | |
{ | |
battle(slime); | |
battleTime++; | |
if(battleTime==1) | |
{ | |
printf("打完一場戰鬥,還剩下四場"); | |
} | |
else if(battleTime==2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int battleTime = 0; | |
for(;;){ | |
battle (slime*2); | |
battleTime=battleTime+1; | |
if (battleTime==1) | |
{ | |
printf("打玩一場戰鬥還剩下四場"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void render() { | |
Gdx.gl.glClearColor(1, 1, 1, 1); | |
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); | |
batch.setProjectionMatrix(camera.combined); | |
batch.begin(); | |
float x = sprite.getX(); | |
x+=0.005f; | |
sprite.setX(x); |
OlderNewer