Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main(void){
- enum {n = 2016};
- int i, number = 0, maxline = 1000, flag = 0;
- char buf[1000], c[1000];
- while (fgets(c, maxline, stdin)){
- strcpy(buf, c);
- number = 0;
- i = 0;
- while (i < maxline && buf[i] != EOF && buf[i] != '\0'){
- if (buf[i] <= '9' && buf[i] >= '0'){
- number = number*10 + (buf[i] - '0');
- if (number > n){
- flag = 1;
- }
- }
- else{
- number = 0;
- }
- i++;
- }
- if (flag == 1){
- puts(c);
- }
- flag = 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement