Skip to content

Instantly share code, notes, and snippets.

@rajivseelam
Created October 9, 2012 10:00
Show Gist options
  • Save rajivseelam/3857734 to your computer and use it in GitHub Desktop.
Save rajivseelam/3857734 to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main(){
int numberOfProblems, problemThatCanBeSolved = 0, countOfPeople;
char line[1024];
char * str;
scanf("%d",&numberOfProblems);
while(numberOfProblems--){
countOfPeople = 0;
fflush(stdin);
gets(line);
str = strtok(line," \r\n\t\0");
while(str!=NULL)
{
countOfPeople += atoi(str);
if(countOfPeople >=2){
problemThatCanBeSolved++;
break;
}
str=strtok(NULL," \r\t\n\0");
}
}
printf("%d\n",problemThatCanBeSolved);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment