You should make sure your code is formatted and indented properly, and nothing is cut out (you're missing a closing brace).
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char matrix[5][35];
char name[5][10];
char surname[5][10];
int IDE[5][6]={0};
int mark[5][3]={0};
int average =0;
int i;
int cnt;
int flag[5]={0};
for (i=0;i<5;i++)
{
fgets(matrix[i], 35, stdin);
}
for (i=0;i<5;i++)
{
sscanf(matrix[i],"%s %s %d %d",name[i],surname[i],&IDE[i],&mark[i]);
}
for (i=0;i<5;i++)
{
printf("%s %s %d %d",name[i],surname[i],IDE[i],mark[i]);
}
return 0;
}
Notice I took the courtesy of replacing gets() with fgets(), since gets() is dangerous and obsolete.
Then make sure you are compiling with full warnings:
$ gcc cboard.c -Wall -Wextra
cboard.c: In function ‘main’:
cboard.c:11:5: warning: missing braces around initializer [-Wmissing-braces]
cboard.c:11:5: warning: (near initialization for ‘IDE[0]’) [-Wmissing-braces]
cboard.c:13:5: warning: missing braces around initializer [-Wmissing-braces]
cboard.c:13:5: warning: (near initialization for ‘mark[0]’) [-Wmissing-braces]
cboard.c:26:9: warning: format ‘%d’ expects argument of type ‘int *’, but argument 5 has type ‘int (*)[6]’ [-Wformat]
cboard.c:26:9: warning: format ‘%d’ expects argument of type ‘int *’, but argument 6 has type ‘int (*)[3]’ [-Wformat]
cboard.c:31:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘int *’ [-Wformat]
cboard.c:31:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘int *’ [-Wformat]
cboard.c:17:9: warning: unused variable ‘flag’ [-Wunused-variable]
cboard.c:16:9: warning: unused variable ‘cnt’ [-Wunused-variable]
cboard.c:14:9: warning: unused variable ‘average’ [-Wunused-variable]
The middle warnings about "format '%d' ..." are the problem. "IDE" and "mark" are two-dimensional arrays, but you are trying to use them as if they were one-dimensional arrays.