Aktualizovat „du5/program.c“
This commit is contained in:
parent
d451b44d26
commit
dcc64bc321
@ -5,13 +5,16 @@ int main(){
|
||||
char name[50][50];
|
||||
int score[50];
|
||||
int pos = 0;
|
||||
char cmpStr[] = "Thrad Zex'lek";
|
||||
char cmpStr1[] = "Thrad Zex'lek";
|
||||
char cmpStr2[] = "Roonuge Gal";
|
||||
//Getting input
|
||||
while(1){
|
||||
scanf("%d %[^\n]", &score[pos], name[pos]);
|
||||
scanf("%*c");
|
||||
pos++;
|
||||
if(strcmp(name[pos - 1], cmpStr) == 0) break;
|
||||
if(!strcmp(name[pos - 1], cmpStr1) == 0) break;
|
||||
if(!strcmp(name[pos - 1], cmpStr2) == 0) break;
|
||||
|
||||
int tmpCh = getc(stdin);
|
||||
if(tmpCh == '\n') break;
|
||||
ungetc(tmpCh, stdin);
|
||||
|
Loading…
Reference in New Issue
Block a user