Skip to content

Instantly share code, notes, and snippets.

@yusukebe
Created March 7, 2010 17:12
Show Gist options
  • Save yusukebe/324485 to your computer and use it in GitHub Desktop.
Save yusukebe/324485 to your computer and use it in GitHub Desktop.
#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