6.c
kaziamir
c_cpp
17 days ago
456 B
4
Indexable
Never
#include<stdio.h> int main(){ int x; scanf("%d",&x); int N; scanf("%d",&N); int key = 0, found = 0; for(int i = 1;i<=N;i++){ scanf("%d",&key); if(key==x){ printf("Right, Player-2 wins!\n"); found = 1; break; } else{ printf("Wrong, %d Choice(s) left!\n",N-i); } } if(found==0){ printf("Player-1 wins!\n"); } return 0; }
Leave a Comment