Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- //player 1 picks a number of x
- int x;
- scanf("%d",&x);
- //player 2 guess the number of n
- int n;
- scanf("%d",&n);
- int i;
- int sum =0;
- for(i=1; i<=n; i++)
- {
- int N;
- scanf("%d",&N);
- if(N==x)
- {
- printf("Right,Player-2 Wins!");
- break;
- }
- else
- {
- int y;
- y=n-i;
- printf("wrong, %d Choice(s) Left!\n",y);
- if(y==0)
- {
- printf("Player,1 Wins!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement