Answer the question
In order to leave comments, you need to log in
Does the filter change the final result depending on how the list sequence is written?
Filter program. Reads a line, looks for an index, compares it - skips or writes to a file.
#include <stdio.h>
#include <string.h>
int main(){
char city[80];
char index[80];
while(scanf("%79[^,],%79[^\n]", city, index) == 2){
if(!strstr(index, "RU")){
printf("%s,%s", city, index);
}
}
return 0;
}
Oslo,NO
Moscow,RU
London,EN
Minsk,BY
Beijing,CH
Krasnodar,RU
Oslo,NO
London,EN
Minsk,BY
Beijing,CH
Moscow,RU
London,EN
Minsk,BY
Beijing,CH
Krasnodar,RU
Oslo,NO
//тут пустая строка
London,EN
Minsk,BY
Beijing,CH
Oslo,NO
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question