C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
char s[20],a[20],*p=NULL; int x;
fgets(s,sizeof(s),stdin);
//printf("%s",s); // for checking data in s
p=strtok(s," ");
//printf("%s",p); // for checking data in p
while(p!=NULL){
x=atoi(p);
if((x%2)==0){
strcpy(a,p);
printf("%s",a);
printf(" ");
}
p=strtok(NULL," ");
}
//printf ("end"); // for checking abnormal output
return 0;
}
/*input->output
12 3 4 6->12 4 6 end (there is additional sapce after 6)
*/
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run