Created
March 7, 2010 17:12
-
-
Save yusukebe/324485 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
// グー: -1, チョキ: 0, パー: 1 | |
int myhand = 0; //チョキ | |
int yourhand = 1; //パー | |
void judge(int handA, int handB); | |
main(void) { | |
if(myhand == yourhand){ | |
printf("あいこだよん\n"); | |
} | |
else if (myhand == 0||yourhand == 0){ | |
judge(myhand,yourhand); | |
}else{ | |
judge(yourhand,myhand); | |
} | |
} | |
void judge(int handA,int handB){ | |
if(handA > handB){ | |
printf("あなたの勝ち\n"); | |
}else{ | |
printf("あなたの負け\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment