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